https://github.com/stefansundin/maxmind-db.js
A MaxMind database reader for web browsers.
https://github.com/stefansundin/maxmind-db.js
javascript-library maxmind-geoip
Last synced: 6 months ago
JSON representation
A MaxMind database reader for web browsers.
- Host: GitHub
- URL: https://github.com/stefansundin/maxmind-db.js
- Owner: stefansundin
- License: mit
- Created: 2022-03-06T06:10:55.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-30T05:11:54.000Z (about 2 years ago)
- Last Synced: 2025-04-03T17:37:40.022Z (6 months ago)
- Topics: javascript-library, maxmind-geoip
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/maxmind-db
- Size: 3.54 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This is a [MaxMind database](https://maxmind.github.io/MaxMind-DB/) reader for web browsers.
Example:
```javascript
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 `` tag (see demo page).
- Demo: https://stefansundin.github.io/maxmind-db.js/
- React demo: https://github.com/stefansundin/maxmind-db.js/tree/react-demo
- Database specification: https://maxmind.github.io/MaxMind-DB/