We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8988db3 commit d6507d1Copy full SHA for d6507d1
README.md
@@ -175,6 +175,25 @@ GEOIP_DATA_DIR=/some/path
175
GEOIP_TMP_DIR=/some/path
176
```
177
178
+Alternatively, you can set the data directory programmatically before requiring the module:
179
+
180
+```js
181
+globalThis['geoDataDir'] = '/some/path';
182
+const geoIp = require('geoip-lite2');
183
+```
184
185
+### Clearing in-memory data
186
187
+`clear()` releases all in-memory GeoIP buffers. Subsequent lookups return `null` until data is reloaded.
188
189
190
+geoIp.clear();
191
+// all lookups return null now
192
193
+geoIp.reloadDataSync();
194
+// data restored
195
196
197
198
## ⚠️ Caveats
199
This package includes the GeoLite database from MaxMind. It is not the most accurate database available,
0 commit comments