update nodejs client and use node-ip2region for npm package name
This commit is contained in:
parent
0a2d8fac38
commit
2e4d5d583e
|
|
@ -1,14 +1,16 @@
|
||||||
# nodejs 客户端
|
# nodejs 客户端
|
||||||
|
|
||||||
|
官方维护的 ip2region, 每次数据更新后会更新到 npm
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
```
|
```
|
||||||
npm install lionsoul-ip2region --save
|
npm install node-ip2region --save
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
```
|
```
|
||||||
const searcher = require('lionsoul-ip2region').create();
|
const searcher = require('node-ip2region').create();
|
||||||
searcher.btreeSearchSync('xxx.xxx.xxx.xxx')
|
searcher.btreeSearchSync('xxx.xxx.xxx.xxx')
|
||||||
// => { city: 2163, region: '中国|0|广东省|深圳市|联通' }
|
// => { city: 2163, region: '中国|0|广东省|深圳市|联通' }
|
||||||
```
|
```
|
||||||
|
|
@ -83,4 +85,4 @@ Rand Name Time (in milliseconds)
|
||||||
4 BinarySearchSync 1.639
|
4 BinarySearchSync 1.639
|
||||||
5 BtreeSearch 3.407
|
5 BtreeSearch 3.407
|
||||||
6 BinarySearch 6.497
|
6 BinarySearch 6.497
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "lionsoul-ip2region",
|
"name": "node-ip2region",
|
||||||
"version": "0.0.1",
|
"version": "1.0.1",
|
||||||
"description": "ip database ",
|
"description": "official nodejs client of ip2region",
|
||||||
"main": "ip2region.js",
|
"main": "ip2region.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
"files": ["data/"],
|
"files": ["data/"],
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/lionsoul2016/ip2region"
|
"url": "https://github.com/lionsoul2014/ip2region"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ip2region",
|
"ip2region",
|
||||||
|
|
@ -20,11 +20,11 @@
|
||||||
"author": "dongyado",
|
"author": "dongyado",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/lionsoul2016/ip2region/issues"
|
"url": "https://github.com/lionsoul2014/ip2region/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/lionsoul2016/ip2region",
|
"homepage": "https://github.com/lionsoul2014/ip2region",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jest": "^19.0.2",
|
"jest": "^19.0.2",
|
||||||
"benchmark": "^2.1.4"
|
"benchmark": "^2.1.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue