node-ip2region
IP Di Zhi Dao Qu Yu Yun Ying Shang IP(Zhi Chi IPv6) to region on Node.js
An Zhuang Shi Yong Shi Yong
$ npm install ip2region --save
{ country: 'Zhong Guo ', province: 'Yan Dong Sheng ', city: 'Shen Zhen Shi ', isp: 'A Li Yun ' }
const res2 = query.search('240e:47d:c20:1627:30a3:ba0d:a5e6:ec19');
console.log(res2);
> { country: "Zhong Guo ", province: "Yan Dong Sheng ", city: "", isp: "Zhong Guo Dian Xin " }">// const IP2Region = require('ip2region').default;
import IP2Region from "ip2region";
const query = new IP2Region();
const res = query.search('120.24.78.68');
console.log(res);
> { country: 'Zhong Guo ', province: 'Yan Dong Sheng ', city: 'Shen Zhen Shi ', isp: 'A Li Yun ' }
const res2 = query.search('240e:47d:c20:1627:30a3:ba0d:a5e6:ec19');
console.log(res2);
> { country: "Zhong Guo ", province: "Yan Dong Sheng ", city: "", isp: "Zhong Guo Dian Xin " }
import IP2Region from "ip2region";
const query = new IP2Region();
const res = query.search('120.24.78.68');
console.log(res);
> { country: 'Zhong Guo ', province: 'Yan Dong Sheng ', city: 'Shen Zhen Shi ', isp: 'A Li Yun ' }
const res2 = query.search('240e:47d:c20:1627:30a3:ba0d:a5e6:ec19');
console.log(res2);
> { country: "Zhong Guo ", province: "Yan Dong Sheng ", city: "", isp: "Zhong Guo Dian Xin " }
Pei Zhi
ipv4db: ipv4 Shu Ju Ku Di Zhiipv6db: ipv6 Shu Ju Ku Di ZhidisableIpv6: Guan Bi ipv6 Cha Xun Gong Neng (Jian Shao Nei Cun Zhan Yong )
import IP2Region from "ip2region";
const query = new IP2Region({
ipv4db: "/tmp/db4.db",
ipv6db: "/tmp/db6.db",
disableIpv6: true,
});
const query = new IP2Region({
ipv4db: "/tmp/db4.db",
ipv6db: "/tmp/db6.db",
disableIpv6: true,
});