https://github.com/metowolf/ipdb-iso3166
IPIP.net database patches (ISO-3166)
https://github.com/metowolf/ipdb-iso3166
ip ipdb ipip iso3166
Last synced: 7 months ago
JSON representation
IPIP.net database patches (ISO-3166)
- Host: GitHub
- URL: https://github.com/metowolf/ipdb-iso3166
- Owner: metowolf
- License: mit
- Created: 2019-03-20T02:46:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-03T12:16:59.000Z (over 6 years ago)
- Last Synced: 2025-03-09T05:39:20.115Z (7 months ago)
- Topics: ip, ipdb, ipip, iso3166
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# ipdb-iso3166
> IPIP.net database patches (ISO-3166)
Free databases available for [download here](https://www.ipip.net/free_download/). If you need better accuracy you should consider buying [commercial subscription](https://www.ipip.net/product/ip.html#ipv4city).
## Install
```
$ npm install @ipdb/iso3166
```## Patches
|value|
|---|
|country_code|
|continent_code|
|timezone|
|utc_offset|
|idd_code|## Usage
```js
const IPDB = require('ipdb');
const ipdb_iso3166 = require('@ipdb/iso3166');
const ipdb = new IPDB('./data/ipipfree.ipdb', {
patches: [ipdb_iso3166]
});ipdb.find('183.62.57.1');
/*
{
code: 0,
data: {
country_name: '中国',
region_name: '广东',
city_name: '广州',
bitmask: 18,
country_code: 'CN',
continent_code: 'AP',
timezone: 'Asia/Shanghai',
utc_offset: 'UTC+8',
idd_code: '86'
}
}
*/
```## Related
- [ipdb](https://github.com/metowolf/ipdb) - IP lookup using IPIP.net database
## License
MIT © [metowolf](https://i-meto.com/)