update nodejs client and use node-ip2region for npm package name

This commit is contained in:
dongyado 2020-02-20 12:58:56 +08:00
parent 03c3ff6264
commit e33004f319
3 changed files with 12 additions and 10 deletions

View File

@ -1,14 +1,16 @@
# nodejs 客户端
官方维护的 ip2region, 每次数据更新后会更新到 npm
## Install
```
npm install lionsoul-ip2region --save
npm install node-ip2region --save
```
## Example
```
const searcher = require('lionsoul-ip2region').create();
const searcher = require('node-ip2region').create();
searcher.btreeSearchSync('xxx.xxx.xxx.xxx')
// => { city: 2163, region: '中国|0|广东省|深圳市|联通' }
```
@ -83,4 +85,4 @@ Rand Name Time (in milliseconds)
4 BinarySearchSync 1.639
5 BtreeSearch 3.407
6 BinarySearch 6.497
```
```

0
binding/nodejs/deploy.sh Normal file → Executable file
View File

View File

@ -1,7 +1,7 @@
{
"name": "lionsoul-ip2region",
"version": "0.0.1",
"description": "ip database ",
"name": "node-ip2region",
"version": "1.0.1",
"description": "official nodejs client of ip2region",
"main": "ip2region.js",
"scripts": {
"test": "jest",
@ -10,7 +10,7 @@
"files": ["data/"],
"repository": {
"type": "git",
"url": "https://github.com/lionsoul2016/ip2region"
"url": "https://github.com/lionsoul2014/ip2region"
},
"keywords": [
"ip2region",
@ -20,11 +20,11 @@
"author": "dongyado",
"license": "ISC",
"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": {
"jest": "^19.0.2",
"benchmark": "^2.1.4"
}
}
}