mirror of
https://github.com/netfun2000/ip2region.git
synced 2026-02-27 09:44:31 +08:00
update nodejs client and use node-ip2region for npm package name
This commit is contained in:
@@ -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
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user