Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/big-kahuna-burger/geo-ip-service
https://github.com/big-kahuna-burger/geo-ip-service
anti-fraud geo ip maxmind mmdb-lib node reader
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/big-kahuna-burger/geo-ip-service
- Owner: big-kahuna-burger
- Created: 2019-07-02T09:17:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-19T19:28:13.000Z (9 months ago)
- Last Synced: 2024-10-14T10:36:39.656Z (23 days ago)
- Topics: anti-fraud, geo, ip, maxmind, mmdb-lib, node, reader
- Language: JavaScript
- Homepage: https://geo-ip-service-green.vercel.app
- Size: 53.1 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- Security: SECURITY.md
Awesome Lists containing this project
README
# Geo IP lookup service
TLDR
HTTP Middleware to look up geo information by IP. Using [maxmind](http://maxmind.com)'s binary database format.Usually we run this as a microservice and expose to other services that want to dynamically fetch it, getting a blazing fast results due to cache usage, rather than installing it in every project which might need it.
## ProjectInstalation:
```sh
npm install --save geo-ip-service
```Usage:
Package exports 3 modules
- iplookup (an initialized Reader if you want to use it directly in your code by giving it an IPv4 or IPv6 address)
- getMiddleware (a factory function if you want to mount it to your existing server application as a middleware, see examples/)
- createServer (if you want to simply run it as individual http service, see example/native-http.js)Updating using postinstall script:
- if you provide it with a MAXMIND_LICENSE_KEY in env vars, a postinstall script will update the database with the latest one from maxmind servers.
In case that headers from maxminds origin server [Last Modified] matches state on disk, it will skip download, so you don't get downloads happening on repeated npm installs[npm-url]: https://www.npmjs.com/package/geo-ip-service
[npm-image]: https://img.shields.io/npm/v/geo-ip-service.svg?style=flat-square