Skip to content
IP lookup using IPIP.net database
Branch: master
Clone or download
Latest commit 11b7405 Apr 5, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore 0.1.0-beta Mar 19, 2019
.travis.yml 0.1.0-beta Mar 19, 2019
index.js testcase of toBits() Apr 5, 2019
license 0.1.0-beta Mar 19, 2019
package.json 0.2.2 Apr 5, 2019
readme.md testcase of toBits() Apr 5, 2019
test.js testcase of toBits() Apr 5, 2019
yarn.lock testcase of toBits() Apr 5, 2019

readme.md

ipdb Build Status

IP lookup using IPIP.net database

Free databases available for download here. If you need better accuracy you should consider buying commercial subscription.

Install

$ npm install ipdb

Usage

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'
  }
}
*/

Related

  • @ipdb/iso3166 - IPIP.net database patches (ISO-3166)
  • @ipdb/cac - IPIP.net database patches (中国行政区划代码)
  • @ipdb/range - IPIP.net database patches (range of cidr)

License

MIT © metowolf

You can’t perform that action at this time.