Skip to content

ipipdotnet/datx-nodejs

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 

重要提示

datx格式将全面升级为ipdb格式 IPDB格式解析代码

ipdb 格式优点

  • 可同时支持IPv4与IPv6
  • 可同时支持中文与英文
  • 查询性能大幅度提高

开发文档

安装说明

 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")); 

About

IPIP.net官方支持的解析datx格式的NodeJS代码

Resources

License

Stars

Watchers

Forks

Packages

No packages published