Socket
Socket
Sign inDemoInstall

bogon

Package Overview
Dependencies
3
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

bogon

Check if an IP is a bogon


Version published
Maintainers
1
Weekly downloads
1,644
decreased by-16.46%
Bundle size
6 kB
Minified + gzipped

Weekly downloads

Readme

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

Last updated on 25 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc