Gathering detailed insights and metrics for mmdb-lib
Gathering detailed insights and metrics for mmdb-lib
Gathering detailed insights and metrics for mmdb-lib
Gathering detailed insights and metrics for mmdb-lib
npm install mmdb-lib
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.6
Supply Chain
93.6
Quality
83.9
Maintenance
100
Vulnerability
100
License
TypeScript (98.93%)
JavaScript (1.07%)
Total Downloads
23,006,934
Last Day
9,374
Last Week
201,704
Last Month
799,176
Last Year
7,201,363
MIT License
30 Stars
315 Commits
12 Forks
3 Watchers
10 Branches
6 Contributors
Updated on Jun 17, 2025
Latest Version
3.0.0
Package Id
mmdb-lib@3.0.0
Unpacked Size
32.49 kB
Size
10.07 kB
File Count
19
NPM Version
10.9.2
Node Version
20.19.1
Published on
May 03, 2025
Cumulative downloads
Total Downloads
Last Day
40.7%
9,374
Compared to previous day
Last Week
8.6%
201,704
Compared to previous week
Last Month
9.5%
799,176
Compared to previous month
Last Year
26.8%
7,201,363
Compared to previous year
Javascript library for working with Maxmind binary databases (aka mmdb or geoip2).
Library is designed to be agnostic to environment and works equally well in node.js and browser. Module is fully compatible with IPv6. There are no differences in API between IPv4 and IPv6.
1npm i mmdb-lib
1import fs from 'fs'; 2import * as mmdb from 'mmdb-lib'; 3 4// Get a buffer with mmdb database, from file system or whereever. 5const db = fs.readFileSync('/path/to/GeoLite2-City.mmdb'); 6 7const reader = new mmdb.Reader<CityResponse>(db); 8console.log(reader.get('66.6.44.4')); // inferred type `CityResponse` 9console.log(reader.getWithPrefixLength('66.6.44.4')); // tuple with inferred type `[CityResponse|null, number]`
Supported response types:
- CountryResponse
- CityResponse
- AnonymousIPResponse
- AnonymousPlusResponse
- AsnResponse
- ConnectionTypeResponse
- DomainResponse
- IspResponse
Library expects to receive an instance of Buffer
during instantiation of Reader
. Since there is no direct alternative of node's Buffer
in browser, you can use https://github.com/feross/buffer that mimics native Buffer
interface. Neither ArrayBuffer
nor Uint8Array
is supported right now. Another requirement is BigInt object available.
Reader(db:Buffer, [options])
options
: <Object>
cache
: <Object>
Cache helper. tiny-lru is great basic option. Only two methods expected: get(key: string | number): any
and set(key: string | number, val: any): void
.MIT
All contributions are welcome. Please make sure to add tests for your changes.
You need to initialise the repository with the following command:
1git submodule update --init --recursive
Then you can run tests with:
1npm test
No vulnerabilities found.
Reason
30 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
packaging workflow detected
Details
Reason
Found 6/9 approved changesets -- score normalized to 6
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More