# bogon

> Check if an IP is a bogon

Latest version **1.3.0** (published 2026-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install bogon
pnpm add bogon
yarn add bogon
bun add bogon
```

## Health

**Score 53/100 (C)** — status: stable.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2026-05-05 |
| First published | 2021-04-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/bogon) |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 35 |
| Author | Mathias Buus |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/bogon
- Repository: https://github.com/mafintosh/bogon
- Issues: https://github.com/mafintosh/bogon/issues
- npm.io page: https://npm.io/package/bogon

## Dependencies (2)

- [compact-encoding](https://npm.io/package/compact-encoding.md) ^3.0.0
- [compact-encoding-net](https://npm.io/package/compact-encoding-net.md) ^1.2.0

## Recent versions

- 1.3.0 (latest) — 2026-05-05
- 1.2.0 — 2026-02-01
- 1.1.0 — 2022-08-25
- 1.0.0 — 2021-04-06
- 0.0.0 — 2021-04-06

## README

# bogon

Check if an IP is a bogon

```
npm install bogon
```

https://ipinfo.io/bogon


## Usage

``` js
const bogon = require('bogon')

console.log(bogon('192.168.0.1')) // true
console.log(bogon('8.8.8.8')) // false
```

As a utility it also exposes an `isPrivate` helper
to detect if a bogon IP is a private IP address on a local network.

``` js
console.log(bogon.isPrivate('192.168.0.1')) // true
console.log(bogon('224.0.1.1')) // true
console.log(bogon.isPrivate('224.0.1.1')) // false
```

## License

MIT

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