# private-ip

> Check if IP address is private.

Latest version **3.0.2** (published 2024-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install private-ip
pnpm add private-ip
yarn add private-ip
bun add private-ip
```

## Health

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

Positive: has types; esm support; high quality score.

Warnings: low downloads; has vulnerabilities.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2024-01-25 |
| First published | 2016-08-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=14.16 |
| Dependencies | 4 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 1 |
| Install scripts | no |
| GitHub stars | 36 |
| Maintainers | frenchbread |
| Keywords | ip, ipv4, ipv6, address, private, netmask, localhost, lan |

## Links

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

## Dependencies (4)

- [netmask](https://npm.io/package/netmask.md) ^2.0.2
- [ip-regex](https://npm.io/package/ip-regex.md) ^5.0.0
- [ipaddr.js](https://npm.io/package/ipaddr.js.md) ^2.1.0
- [@chainsafe/is-ip](https://npm.io/package/@chainsafe/is-ip.md) ^2.0.1

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 3.0.2 (latest) — 2024-01-25
- 3.0.1 — 2023-07-08
- 3.0.0 — 2022-11-13
- 2.3.4 — 2022-08-08
- 2.3.3 — 2021-11-08
- 2.3.2 — 2021-11-08
- 2.3.1 — 2021-10-25
- 2.3.0 — 2021-10-12
- 2.2.1 — 2021-04-16
- 2.2.0 — 2021-04-07
- 2.1.1 — 2020-11-29
- 2.1.0 — 2020-11-28
- 2.0.0 — 2020-11-23
- 1.0.5 — 2017-04-29
- 1.0.2 — 2016-08-03
- … 3 more at https://npm.io/package/private-ip/versions

## README

private-ip
--

> Check if IP address is private.

### badges

[![huntr](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev)

### Installation

```bash
❯ npm install private-ip --save

or

❯ yarn add private-ip
```

### Usage

```js
import is_ip_private from 'private-ip'

is_ip_private('10.0.0.0')
// => true

is_ip_private('101.0.26.90')
// => false

is_ip_private('not.an.ip.com')
// => undefined

```

### Development

##### Tests

```bash
$ yarn run test
```

##### Build

```bash
$ yarn run build
```

### Authors

- Damir Mustafin [@frenchbread](https://github.com/frenchbread)
- Sick.Codes [@sickcodes](https://github.com/sickcodes) - [https://twitter.com/sickcodes](https://twitter.com/sickcodes)
- John Jackson [@johnjhacking](https://github.com/johnjhacking) - [https://twitter.com/johnjhacking](https://twitter.com/johnjhacking)
- Nick Sahler [@nicksahler](https://github.com/nicksahler) - [https://twitter.com/tensor_bodega](https://twitter.com/tensor_bodega)

### Credits

[https://github.com/frenchbread/private-ip/blob/master/CREDITS.md](https://github.com/frenchbread/private-ip/blob/master/CREDITS.md)

### License
[MIT](https://github.com/frenchbread/private-ip/blob/master/LICENSE)

### IANA Reserved IP list

https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry-1.csv

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