bogon
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/bogon package

1.1.0 • Public • Published

bogon

Check if an IP is a bogon

npm install bogon

https://ipinfo.io/bogon

Usage

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.

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

Readme

Keywords

none

Package Sidebar

Install

npm i bogon

Weekly Downloads

1,765

Version

1.1.0

License

MIT

Unpacked Size

8.03 kB

Total Files

7

Last publish

Collaborators

  • mafintosh