geoip-lite2
Advanced tools
Comparing version 2.1.8 to 2.1.9
{ | ||
"name": "geoip-lite2", | ||
"version": "2.1.8", | ||
"version": "2.1.9", | ||
"description": "A light weight native JavaScript implementation of GeoIP API from MaxMind.", | ||
@@ -65,5 +65,5 @@ "keywords": [ | ||
"iconv-lite": "0.6.3", | ||
"ip-address": "^8.1.0", | ||
"ip-address": "^9.0.5", | ||
"lazy": "1.0.11", | ||
"rimraf": "^5.0.1" | ||
"rimraf": "^5.0.4" | ||
}, | ||
@@ -70,0 +70,0 @@ "devDependencies": { |
<div align="center"> | ||
<h1>🗺️ GeoIP-Lite2 v2.1 - Now even faster!</h1> | ||
A native Node.js API for the GeoLite data from MaxMind.<br> | ||
This product includes GeoLite data created by MaxMind, available from: https://www.maxmind.com | ||
<br><br> | ||
<img src="https://cdn.sefinek.net/images/npm/geoip-lite2/banner.jpg" alt="GeoIP-Lite2 v2.1 🗺️ Now even faster!"> | ||
<br> | ||
<p> | ||
A native <a href="https://nodejs.org" target="_blank" title="Open nodejs.org">Node.js</a> API for the GeoLite data from MaxMind.<br> | ||
This product includes GeoLite data created by MaxMind, available from: <a href="https://www.maxmind.com" target="_blank" title="Open www.maxmind.com">www.maxmind.com</a> | ||
</p> | ||
<a href="https://www.npmjs.com/package/geoip-lite2" target="_blank" title="geoip-lite2 - npm" style="text-decoration:none"> | ||
@@ -17,3 +19,3 @@ <img src="https://img.shields.io/npm/dt/geoip-lite2?maxAge=3600" alt="The number of downloads"> | ||
🚀 Improved GeoIP Module by [Sefinek](https://sefinek.net) | ||
------------ | ||
------------------------------------------ | ||
This module is an improved and updated edition of [geoip-lite](https://github.com/geoip-lite/node-geoip), thoughtfully designed to meet the latest programming standards. | ||
@@ -31,11 +33,13 @@ | ||
✨ Demonstration | ||
------------ | ||
You can see this module in action on my official API. Generally speaking, the API interface is public, and you can safely use it in your projects. Happy coding! | ||
---------------- | ||
You can see this module in action on my [official API](https://sefinek.net). Generally speaking, the API interface is public, and you can safely use it in your projects. Happy coding! | ||
> Endpoint : https://api.sefinek.net/api/v2/geoip/{ip} | ||
> Endpoint : https://api.sefinek.net/api/v2/geoip/ | ||
> Example : https://api.sefinek.net/api/v2/geoip/109.207.159.255 | ||
📑 Introduction | ||
------------ | ||
--------------- | ||
MaxMind provides a set of data files for IP to Geo mapping along with opensource libraries to parse and lookup these data files. | ||
@@ -52,7 +56,7 @@ One would typically write a wrapper around their C API to get access to this data in other languages (like JavaScript). | ||
> **Warning** | ||
> **You MUST update the data files after installation.** The MaxMind license does not allow us to distribute the latest version of the data files with this package. Follow the instructions under update the datafiles for details. | ||
> **You SHOULD update the data files after installation.** The MaxMind license does not allow us to distribute the latest version of the data files with this package. Follow the instructions under update the datafiles for details. | ||
📚 Philosophy | ||
---------- | ||
------------- | ||
I was really aiming for a fast JavaScript native implementation for geomapping of IPs. | ||
@@ -63,3 +67,3 @@ My prime motivator was the fact that it was really hard to get libgeoip built for Mac OSX without using the library from MacPorts. | ||
🕵️♂️ Why GeoIP-Lite? | ||
------------- | ||
------------------ | ||
GeoIP-Lite is a fully JavaScript implementation of the MaxMind GeoIP API. It is not as fully featured as bindings that use `libgeoip`. | ||
@@ -71,3 +75,3 @@ By reducing scope, this package is about 40% faster at doing lookups. On average, an IP to Location lookup should take 20 microseconds on | ||
📝 Synopsis | ||
-------- | ||
------------ | ||
### Script | ||
@@ -100,3 +104,4 @@ ```javascript | ||
🛠️ Installation | ||
------------ | ||
---------------- | ||
### 1. Get the library | ||
@@ -119,3 +124,3 @@ ```cmd | ||
🧩 API | ||
--- | ||
------- | ||
GeoIP-Lite2 is completely synchronous. There are no callbacks involved. | ||
@@ -139,3 +144,3 @@ All blocking file IO is done at startup time, so all runtime calls are executed in-memory and are fast. | ||
range: [ <low bound of IP block>, <high bound of IP block> ], | ||
country: 'XX', // 2 letter ISO-3166-1 country code | ||
country: 'CC', // 2 letter ISO-3166-1 country code | ||
region: 'RR', // Up to 3 alphanumeric variable length characters as ISO 3166-2 code | ||
@@ -172,3 +177,3 @@ // For US states this is the 2 letter state | ||
🔄 Built-in Updater | ||
---------------- | ||
-------------------- | ||
This package contains an update script that can pull the files from MaxMind and handle the conversion from CSV. | ||
@@ -192,3 +197,3 @@ A npm script alias has been setup to make this process easy. Please keep in mind this requires internet and MaxMind | ||
You can also run it by doing: | ||
```bash | ||
```shell | ||
node ./node_modules/geoip-lite2/scripts/updatedb.js license_key=YOUR_LICENSE_KEY | ||
@@ -224,3 +229,3 @@ ``` | ||
⚠️ Caveats | ||
------- | ||
----------- | ||
This package includes the GeoLite database from MaxMind. This database is not the most accurate database available, | ||
@@ -236,3 +241,3 @@ however it is the best available for free. You can use the commercial GeoIP database from MaxMind with better | ||
### Memory usage | ||
Quick test on memory consumption shows that library uses around 100Mb per process. | ||
Quick test on memory consumption shows that library uses around 100 MB per process. | ||
@@ -257,3 +262,3 @@ ```javascript | ||
🔀 Alternatives | ||
---------- | ||
--------------- | ||
If your use-case requires doing less than 100 queries through the lifetime of your application or if you need really fast latency on start-up, you might want to look into [fast-geoip](https://github.com/onramper/fast-geoip) a package with a compatible API that is optimized for serverless environments and provides faster boot times and lower memory consumption at the expense of longer lookup times. | ||
@@ -263,16 +268,16 @@ | ||
🔖 References | ||
---------- | ||
- <a href="http://www.maxmind.com/app/iso3166">Documentation from MaxMind</a> | ||
- <a href="http://en.wikipedia.org/wiki/ISO_3166">ISO 3166 (1 & 2) codes</a> | ||
- <a href="http://en.wikipedia.org/wiki/List_of_FIPS_region_codes">FIPS region codes</a> | ||
------------- | ||
- <a href="http://www.maxmind.com/app/iso3166">Documentation from MaxMind</a> | ||
- <a href="http://en.wikipedia.org/wiki/ISO_3166">ISO 3166 (1 & 2) codes</a> | ||
- <a href="http://en.wikipedia.org/wiki/List_of_FIPS_region_codes">FIPS region codes</a> | ||
©️ Copyright | ||
--------- | ||
`GeoIP-Lite` is Copyright 2011-2018 Philip Tellis <philip@bluesmoon.info> | ||
`GeoIP-Lite2` is Copyright 2023 Sefinek <contact@sefinek.net> (https://sefinek.net) | ||
------------ | ||
`GeoIP-Lite` is Copyright 2011-2018 **Philip Tellis** <philip@bluesmoon.info> | ||
`GeoIP-Lite2` is Copyright 2023 **Sefinek** <contact@sefinek.net> (https://sefinek.net) | ||
🔐 License | ||
------- | ||
There are two licenses for the code and data. See the [LICENSE](LICENSE) file for details. | ||
---------- | ||
There are two licenses for the code and data. See the [LICENSE](LICENSE) file for details. |
@@ -1,1 +0,1 @@ | ||
const o=require('../lib/geoip.js').lookup('158.255.88.0');console.log(o); | ||
const o=require('../lib/geoip.js').lookup('86.63.89.41');console.log(o); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
269
179374124
+ Addedip-address@9.0.5(transitive)
+ Addedsprintf-js@1.1.3(transitive)
- Removedip-address@8.1.0(transitive)
- Removedsprintf-js@1.1.2(transitive)
Updatedip-address@^9.0.5
Updatedrimraf@^5.0.4