1.0.3 ⢠Published 10 months ago
libmaxmind v1.0.3
libmaxmind
Thin wrapper over npm mmdb-lib
, repackaged for direct use in browsers.
!IMPORTANT
Reader
class is enhanced withArrayBuffer
support.
Under the hood this package includes browser-compatible Buffer implementation and shims some of the Node.js APIs used by the library.
⨠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