-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathpackage.json
31 lines (31 loc) · 2.64 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
"name": "geoip-native",
"description": "A fast, native JavaScript geoip api. This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com",
"keywords": [
"geoip",
"iplookup",
"ip",
"country"
],
"version": "0.0.7",
"author": {
"name": "Playtomic Inc"
},
"repository": {
"type": "git",
"url": "https://github.com/benlowry/node-geoip-native.git"
},
"engines": {
"node": ">=0.6.0"
},
"main" : "./index.js",
"licenses": [
{
"type": "MIT",
"url": "http://opensource.org/licenses/mit-license.php"
}
],
"readme": "# Node GeoIP Native\n\nThis package is a lightning-fast, native JavaScript geoip lookup built on [MaxMind](http://www.maxmind.com/)'s free country database.\n\nIt is non-blocking and operates without any IO after initially loading the data into memory.\n\nResults are 4 - 5 times faster than [geoip-lite](https://github.com/bluesmoon/node-geoip) with the caveat that it takes 2 or 3 times longer to initialize and uses 60 or 70 megabytes memory.\n\nThis is used in production at [Playtomic](https://playtomic.com/) in a [high volume API](https://success.heroku.com/playtomic) where performance matters.\n\nBenchmarks on my 2011 Macbook Air whilst running lots of software. The test took the middle 10 results from 20 iterations and averaged them. The APIs are interchangeable so tests were identical.\n\n\tgeoip-native:\taverage: 1540.3ms / million lookups\n\tgeoip-lite: \taverage: 8375.3ms / million lookups\n\n## Requires\n\n1. Comes with the [standard CSV database by MaxMind](http://www.maxmind.com/app/geolite) which may require updating.\n\n## How to use\n1. git clone https://github.com/benlowry/node-geoip-native\n2. cd node-geoip-native\n3. node test.js\n\nor just ```npm install geoip-native```\n\n## Methods\n\nNode GeoIP Native provides methods for:\n\n1. ```lookup``` performs the lookup, takes the ip address as a parameter\n\n## Examples\n\n\tvar geoip = require(\"geoip-native\");\n\tvar ip = \"123.123.123.123\";\n\tgeoip.lookup(ip);\n\tconsole.log(\"country: \" + ip.name + \" / \" + ip.code);\n\n\t// in practice you'd want:\n\t// ip = request.headers[\"x-forwarded-for\"] || request.connection.remoteAddress,\n\n### What's missing\nBe neat to expand this to include cities.\n\n### License\nCopyright [Playtomic Inc](https://playtomic.com), 2012. Licensed under the MIT license. Certain portions may come from 3rd parties and carry their own licensing terms and are referenced where applicable.\n\nThis product includes GeoLite data created by MaxMind, available from http://www.maxmind.com\n",
"_id": "geoip-native@0.0.2",
"_from": "geoip-native"
}