# find-ip-location

> query ip location using ipb ip databases

Latest version **0.0.3** (published 2017-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install find-ip-location
pnpm add find-ip-location
yarn add find-ip-location
bun add find-ip-location
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-07-08 |
| First published | 2017-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | liuwill |
| Maintainers | liuwill |
| Keywords | ip, geo, code, binary |

## Links

- npm: https://www.npmjs.com/package/find-ip-location
- Repository: https://github.com/liuwill/find-ip-location
- Homepage: https://github.com/liuwill/find-ip-location#readme
- Issues: https://github.com/liuwill/find-ip-location/issues
- npm.io page: https://npm.io/package/find-ip-location

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2017-07-08
- 0.0.2 — 2017-07-06
- 0.0.1 — 2017-07-06

## README

# find-ip-location
  [![Build Status][travis-image]][travis-url]
  [![Coverage Status][coverage-image]][coverage-url]
  [![NPM version][npm-image]][npm-url]
  [![Code Climate][quality-image]][quality-url]
  [![bitHound][bithound-image]][bithound-url]
  [![David][david-dependency-image]]()

参考[maxmind](https://github.com/runk/node-maxmind)实现的纯javascript地址库；基于[ipb](http://iac-i.org/#)提供的付费ip地址库实现ip地址解析，中国国内的地址精确到省市，国外的精确到国家。需要使用配套工具将提供的ip地址库文件，转换成工具需要的二进制格式文件。该地址库主要针对中国国内的ip地址解析。

## Installation

```shell
$ npm install --save find-ip-location
```

## Usage：

```javascript
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](./LICENSE)

[npm-image]: https://img.shields.io/npm/v/find-ip-location.svg?style=flat-square
[npm-url]: https://npmjs.org/package/find-ip-location
[travis-image]: https://img.shields.io/travis/liuwill/find-ip-location/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/liuwill/find-ip-location
[download-image]: https://img.shields.io/npm/dm/find-ip-location.svg?style=flat-square
[download-url]: https://npmjs.org/package/find-ip-location
[coverage-image]: https://img.shields.io/coveralls/liuwill/find-ip-location/master.svg?style=flat-square
[coverage-url]: https://coveralls.io/github/liuwill/find-ip-location
[licence-image]: https://img.shields.io/npm/l/find-ip-location.svg?style=flat-square
[david-dependency-image]: https://img.shields.io/david/liuwill/find-ip-location.svg?style=flat-square
[david-dev-image]: https://img.shields.io/david/dev/liuwill/find-ip-location.svg?style=flat-square
[quality-image]: https://img.shields.io/codeclimate/github/liuwill/find-ip-location.svg?style=flat-square
[quality-url]: https://codeclimate.com/github/liuwill/find-ip-location
[bithound-image]: https://img.shields.io/bithound/code/github/liuwill/find-ip-location.svg?style=flat-square
[bithound-url]: https://www.bithound.io/github/liuwill/find-ip-location

---
_Source: https://npm.io/package/find-ip-location · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
