Registry / database / maxmind-asn

maxmind-asn

JSON →
library1.0.3-20191224jsnpmunverified

Provides pre-packaged MaxMind GeoLite2 ASN database for use with node-maxmind. This package distributes the ASN database (autonomous system number and organization) for IP geolocation lookups, released weekly. Version 1.0.3-20191224 is the latest. It simplifies integrating MaxMind's free GeoLite2 databases into Node.js applications by avoiding manual downloads. Compared to alternatives like geoip-lite, it offers more accurate and up-to-date data via MaxMind's official databases. Note the licensing changes effective December 30, 2019, requiring a free MaxMind account for database access.

npm install maxmind-asn
INSTALL
IMPORT
SIG · MAXMIND-ASN
M
maxmind-asn
databasejavascriptv1.0.3-20191224
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

maxmind-asn
import maxmind from 'maxmind'; const asn = maxmind.openSync(require('maxmind-asn'));
import asn from 'maxmind-asn';
Do not import maxmind-asn directly; it is a packaged database file for use with 'maxmind' package.
maxmind
import maxmind from 'maxmind';
const maxmind = require('maxmind');
node-maxmind supports both ESM and CommonJS. The package is ESM-first, but CommonJS require works as well.
lookupASN.get()
const lookup = maxmind.openSync(require('maxmind-asn')); const result = lookup.get('8.8.8.8');
const result = require('maxmind-asn').get('8.8.8.8');
The database must be opened via maxmind.openSync() before calling .get()

Opens the bundled MaxMind ASN database synchronously and looks up an IP address.

import maxmind from 'maxmind'; import asnDb from 'maxmind-asn'; const lookup = maxmind.openSync(asnDb); const result = lookup.get('8.8.8.8'); console.log(result); // { // autonomous_system_number: 15169, // autonomous_system_organization: 'Google LLC' // }
Debug
Known issues
breakingLicense changes effective December 30, 2019 require a free MaxMind account and API key to download GeoLite2 databases, but as of v1.0.3-20191224, the npm package still bundles the database. Future updates may require manual download or API key.
fix
Check MaxMind blog for updates; consider using 'maxmind' package with manual database download and API key.
affects: >=1.0.3
deprecatedThe maxmind-databases packages (maxmind-asn, maxmind-country, maxmind-city) may be deprecated in favor of a more integrated approach with node-maxmind's built-in database download.
fix
Use node-maxmind's new database download features instead of separate npm packages.
affects: >=1.0.0
gotchaThe database is bundled and installed in node_modules; it may become stale. For up-to-date data, users should consider downloading the latest database manually.
fix
Periodically update the package to get the latest database, or use MaxMind's direct download.
affects: *
gotchaThe package size is ~5 MB uncompressed; it may not be suitable for environments with strict size limits.
fix
Evaluate if bundling a full database is acceptable for your use case.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'maxmind-asn'
Missing import of the package; user may have forgotten to install it or used wrong import syntax.
fix
Run 'npm install maxmind-asn' and ensure you import using require('maxmind-asn') (CommonJS) or import 'maxmind-asn' (ESM).
TypeError: maxmind.openSync is not a function
Using a version of node-maxmind that does not export openSync (e.g., very old version).
fix
Install the latest node-maxmind version: 'npm install maxmind@latest'
Error: ENOTDIR: not a directory, open '/path/to/node_modules/maxmind-asn/index.mmdb'
The packaged file structure may be incorrect or the package was corrupted.
fix
Reinstall the package: 'npm install maxmind-asn'
Upgrade
Version history
1.0.3-20191224latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
maxmind-asn — npm install maxmind-asn · libregistry