You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A native <a href="https://nodejs.org" target="_blank" title="Open nodejs.org">Node.js</a> API for GeoLite data from MaxMind.<br>
8
8
This library includes GeoLite data created by MaxMind, available from <a href="https://www.maxmind.com" target="_blank" title="Open www.maxmind.com">maxmind.com</a>.
@@ -20,15 +20,15 @@ Actively maintained and optimized fork of [geoip-lite](https://github.com/geoip-
20
20
Fully native JS implementation with synchronous, in-memory lookups for IPv4 and IPv6.
21
21
Includes automated test coverage using [Jest](https://www.npmjs.com/package/jest).
22
22
23
-
> [!WARNING]
24
-
> Remember to regularly update the MaxMind database! You will need a token for this.
23
+
> [!WARNING]
24
+
> Remember to regularly update the MaxMind database! You will need a license key for this.
25
25
26
-
> [!NOTE]
26
+
> [!NOTE]
27
27
> This requires a large amount of RAM. It is known to fail on a Digital Ocean or AWS micro instance.
28
28
> This behavior is intentional, as the library prioritizes performance by keeping all data in memory.
29
29
30
-
> [!NOTE]
31
-
> Please note that IPv6 geolocation data may be less complete depending on the version of the GeoLite database.
30
+
> [!NOTE]
31
+
> IPv6 geolocation data may be less complete depending on the version of the GeoLite database.
32
32
33
33
34
34
## 🛠️ Installation
@@ -38,7 +38,15 @@ npm install geoip-lite2
38
38
```
39
39
40
40
### 2. Update the data files (required)
41
-
Run `cd node_modules/geoip-lite2 && npm run updatedb license_key=YOUR_LICENSE_KEY` to update the data files. Replace `YOUR_LICENSE_KEY` with your license key obtained from [maxmind.com](https://support.maxmind.com/hc/en-us/articles/4407111582235-Generate-a-License-Key).
41
+
Run the update script with your MaxMind license key (obtainable for free from [maxmind.com](https://support.maxmind.com/hc/en-us/articles/4407111582235-Generate-a-License-Key)):
42
+
```shell
43
+
cd node_modules/geoip-lite2 && npm run updatedb license_key=YOUR_LICENSE_KEY
44
+
```
45
+
46
+
Or set the key via an environment variable and run from your project root:
0 commit comments