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.2
Supply Chain
93.3
Quality
76.8
Maintenance
100
Vulnerability
100
License
TypeScript (98.6%)
JavaScript (1.4%)
Total Downloads
19,452,120
Last Day
10,339
Last Week
110,386
Last Month
615,136
Last Year
6,224,558
28 Stars
270 Commits
10 Forks
5 Watching
7 Branches
5 Contributors
Minified
Minified + Gzipped
Latest Version
2.1.1
Package Id
mmdb-lib@2.1.1
Unpacked Size
33.65 kB
Size
10.22 kB
File Count
19
NPM Version
10.8.0
Node Version
20.13.1
Publised On
29 May 2024
Cumulative downloads
Total Downloads
Last day
-71.2%
10,339
Compared to previous day
Last week
-28%
110,386
Compared to previous week
Last month
8.2%
615,136
Compared to previous month
Last year
16.1%
6,224,558
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
- 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
no dangerous workflow patterns detected
Reason
15 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
Found 0/15 approved changesets -- score normalized to 0
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 2024-12-16
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