Socket
Book a DemoInstallSign in
Socket

find-ip-location

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-ip-location

query ip location using ipb ip databases

0.0.3
latest
Source
npmnpm
Version published
Weekly downloads
1
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

find-ip-location

Build Status Coverage Status NPM version Code Climate bitHound David

参考maxmind实现的纯javascript地址库;基于ipb提供的付费ip地址库实现ip地址解析,中国国内的地址精确到省市,国外的精确到国家。需要使用配套工具将提供的ip地址库文件,转换成工具需要的二进制格式文件。该地址库主要针对中国国内的ip地址解析。

Installation

$ npm install --save find-ip-location

Usage:

var ipQuery = require("find-ip-location")
var sampleFilePath = 'db path'

// Sync
var ipFinder = ipQuery.loadDBSync(sampleFilePath)
ipFinder.find('66.6.44.4')

// Async
ipQuery.loadDB(sampleFilePath, (err, ipFinder) => {
  if(err){
    console.log(err.message)
  }else{
    ipFinder.find('66.6.44.4')
  }
})

返回的参数包含:["startIP", "endIP", "code", "province", "hanCity", "city", "isoCode", 'provinceCode', 'cityCode', 'countryCode', 'country']

License

MIT

Keywords

ip

FAQs

Package last updated on 08 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.