New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

bogon

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bogon

Check if an IP is a bogon

latest
Source
npmnpm
Version
1.3.0
Version published
Weekly downloads
20K
-20.21%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 05 May 2026

Related posts