
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
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.
npm i mmdb-lib
import fs from 'fs';
import * as mmdb from 'mmdb-lib';
// Get a buffer with mmdb database, from file system or whereever.
const db = fs.readFileSync('/path/to/GeoLite2-City.mmdb');
const reader = new mmdb.Reader<CityResponse>(db);
console.log(reader.get('66.6.44.4')); // inferred type `CityResponse`
console.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
add a link
FAQs
Maxmind DB (MMDB) Library
The npm package mmdb-lib receives a total of 177,982 weekly downloads. As such, mmdb-lib popularity was classified as popular.
We found that mmdb-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.