IPIP.net官方支持的解析datx格式的NodeJS代码
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib update Apr 8, 2018
LICENSE Initial commit Mar 4, 2018
README.md update Apr 3, 2018
example.js update code Mar 7, 2018
index.js update code Mar 7, 2018
package.json update Apr 8, 2018

README.md

开发文档

安装说明

 npm -y install ipip-datx

示例


const datx = require('ipip-datx'); // 引入ipip-datx模块

var city = new datx.City("/path/to/mydata4vipday4.datx");
 // findSync 此方法只接受IPv4类型的IP地址,请自行检查参数是否符合规定;
console.log(city.findSync("123.121.17.72"));

var district = new datx.District("/path/to/quxian.datx");
// findSync 此方法只接受IPv4类型的IP地址,请自行检查参数是否符合规定;
console.log(district.findSync("123.121.17.72"));