@dokebi/geoip
v0.1.3
Published
Offline IP geolocation for Dokebi from operator-provided MaxMind DB (.mmdb) files (GeoLite2, GeoIP2, DB-IP Lite): country, region, city, location and ISP in memory, complete special-purpose address ranges, a bounded LRU cache, files reopened without a res
Maintainers
Readme
@dokebi/geoip
Offline IP geolocation for Dokebi: the country, region, city, coordinates, time zone and ISP of an address, read in memory from MaxMind DB (.mmdb) files the operator provides — MaxMind GeoLite2 (recommended, a free account and its EULA), GeoIP2, or DB-IP Lite (CC BY 4.0, no account). No lookup leaves the process.
geoip.lookup(request.ip) gives every field (or unknown with a reason), geoip.locate(request.ip, { precision }) the { country, region, city? } to keep instead of the address. Private networks (RFC 1918, loopback, link-local, unique local) answer private and every other special-purpose range (documentation, shared address space, benchmarking, multicast) reserved, without a lookup; IPv4-mapped, NAT64, 6to4 and Teredo addresses are looked up by the IPv4 address they carry. Results sit in a bounded LRU cache; a replaced file is opened without a restart and swapped in only once fully checked; a missing database never stops the app unless you say so. npx dokebi-geoip download fetches, verifies and atomically installs the files from URLs kept in the environment.
Install with npx dokebi add @dokebi/geoip. Node >=24.0.0. The package ships no database.
See AI.md for the database licenses and attribution, the API, the address rules, the refresh, the download command, the options and the error codes.
