IP lookup using IPIP.net database
Free databases available for download here. If you need better accuracy you should consider buying commercial subscription.
$ npm install ipdb
const IPDB = require('ipdb');
const ipdb = new IPDB('./data/ipipfree.ipdb');
ipdb.find('183.62.57.1');
/*
{
code: 0,
data: {
country_name: '中国',
region_name: '广东',
city_name: '广州',
bitmask: 18,
ip: '183.62.57.1'
}
}
*/Type: string | Buffer
The ipdb database pathname (string) or contents (buffer).
Type: object
Type: array
Default: []
See Patches
Return a result object
Type: string
Type: object
Type: string
Default: CN
Type: array
Default: []
See Patches
- @ipdb/iso3166 - IPIP.net database patches (ISO-3166)
- @ipdb/cac - IPIP.net database patches (中国行政区划代码)
- @ipdb/range - IPIP.net database patches (range of cidr)
- @ipdb/database - IPIP.net free database
- qqwry.ipdb - 纯真数据库 IPIP.net 格式版
MIT © metowolf