Socket
Socket
Sign inDemoInstall

isipaddress

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isipaddress

Pure Javascript implementation for truly checking if the provided input is an IP address. Based on RFC 791 (IPv4), RFC 4291 (IPv6), and RFC 4632 (CIDR).


Version published
Weekly downloads
382
decreased by-35.58%
Maintainers
1
Weekly downloads
 
Created
Source

isIP

NPM version Build Status Coverage Status

Pure Javascript implementation for truly checking if the provided input is an IP address. Based on RFC 791 (IPv4), RFC 4291 (IPv6), and RFC 4632 (CIDR).

Install

NPM
$ npm install isipaddress

Node.js

var isIP = require('isipaddress');

isIP.test('127.0.0.1'); // returns true
isIP.test('FEDC:BA98:7654:3210:FEDC:BA98:7654:3210/16'); // returns true
isIP.test('Bananas in pajamas are coming down the stairs'); // returns false

isIP.v4('127.0.0.1'); // returns true
isIP.v4('127.0.0.1/18'); // returns true
isIP.v4('FEDC:BA98:7654:3210:FEDC:BA98:7654:3210'); // returns false

isIP.v6('127.0.0.1'); // returns false
isIP.v6('FEDC:BA98:7654:3210:FEDC:BA98:7654:3210'); // returns true
isIP.v6('FEDC:BA98:7654:3210:FEDC:BA98:7654:3210/32'); // returns true

License

MIT

Keywords

FAQs

Package last updated on 18 Oct 2014

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc