Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/runk/geotools
nodejs geo lookup module
https://github.com/runk/geotools
Last synced: 2 months ago
JSON representation
nodejs geo lookup module
- Host: GitHub
- URL: https://github.com/runk/geotools
- Owner: runk
- Created: 2012-11-21T12:15:59.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2022-11-01T22:44:01.000Z (about 2 years ago)
- Last Synced: 2024-09-10T15:49:58.866Z (3 months ago)
- Language: JavaScript
- Size: 5.7 MB
- Stars: 8
- Watchers: 5
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
geotools
========Simple and fast IP to Country/Region lookup module for nodejs. **Pull Requests are welcome!**
## GEO databases
You can download fresh geo database from this website: http://ipgeobase.ru/.
Database contains major ranges for all countries worldwide and precise ranges for most Russian cities/regions.
It could also be extended with other generic geo data.## Installation
npm install geotools
## Usage
var geo = require('geotools');
var res = geo.lookup('87.229.134.24');
/**
* Output is:
* {
* country: 'RU',
* region: 1056,
* city: 'Березовский',
* regionName: 'Свердловская область',
* district: 'Уральский федеральный округ',
* lat: '56.912811',
* lon: '60.804699',
* utcOffset: '+05:00'
* }
*/## Speed / Benchmark
Approximate speed on average laptop is about 1.5M calls per second. Benchmark is simple, but it gives you an idea about module's performance. Test it yourself:
node ./lib/bench.js