Skip to content

Fast and efficient maxmind library implementation. Ready for direct use in the browser, no build tools required. Batteries included.

Notifications You must be signed in to change notification settings

nilfalse/maxmind

Repository files navigation

libmaxmind

Depfu

Thin wrapper over npm mmdb-lib, repackaged for direct use in browsers.

Important

Reader class is enhanced with ArrayBuffer support.

Under the hood this package includes browser-compatible Buffer implementation and shims some of the Node.js APIs used by the library.

✌️ Check out github.com/nilfalse/ctf for real-world usage.

✨ Usage

import { Reader } from 'https://esm.run/libmaxmind';

const response = await fetch(
  'https://raw.githubusercontent.com/maxmind/MaxMind-DB/main/test-data/GeoLite2-Country-Test.mmdb'
);

const arrayBuffer = await response.arrayBuffer();
const reader = new Reader(arrayBuffer);

reader.get('89.160.20.122');

Apart from ArrayBuffer support the rest of API is left intact.

👏 Credits

⚖ License

MIT

About

Fast and efficient maxmind library implementation. Ready for direct use in the browser, no build tools required. Batteries included.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published