0.0.4 • Published 2 years ago

maxmind-db v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

This is a MaxMind database reader for web browsers.

Example:

const response = await fetch('/path/to/GeoLite2-City.mmdb', {
  cache: 'force-cache',
});
if (!response.ok) {
  throw new Error(`Error fetching database: ${response.status} ${response.statusText}`);
}
const maxmind = new MaxMindDB();
await maxmind.load(response);
console.log(maxmind.get('1.1.1.1'));

Status: this is a brand new package so there are probably bugs. Please open a GitHub issue if you find one.

You can get this package from npm, or load the code directly in a <script> tag (see demo page).