proper-ip

1.1.0 • Public • Published

proper-ip.js

Validate IPv4 and IPv6 addresses

⚙️ Installation

npm i proper-ip

CDN Links:

📖 Usage

▪ Import

// ES6
import properIp from "proper-ip";

// commonjs
const properIp = require("proper-ip");

▪ Check IPv4

properIp("192.168.0.1"); // True

properIp("10.0.0"); // False

▪ Check IPv6

properIp("2001:0db8:85a3:0000:0000:8a2e:0370:7334", "v6"); // True

properIp("hello world", "v6"); // False

Make sure to console.log() the values to see the output!


Support me on PatreonCheck out my socials

Package Sidebar

Install

npm i proper-ip

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

3.16 kB

Total Files

4

Last publish

Collaborators

  • axoraxdev