Skip to content

ip-address

457 1 50 MIT
8.1.0 (7 months ago) May 05 2015 1.4 million (month)

The "ip-address" library is a Node.js library that provides utility functions for working with IP addresses, similar to "ip" library. It provides functions for parsing, validating, and converting IP addresses between different formats, both IPv4 and IPv6.

Example Use


const IPAddress = require("ip-address").Address;

// slice and manipulate addresses:
const ipv4 = new IPAddress("192.168.1.1");
console.log(ipv4.addressMinusSuffix); // '192.168.1'

// validate addresses:
console.log(IPAddress.isValid("192.168.1.1")); // true
console.log(IPAddress.isValid("2001:0db8:85a3:0000:0000:8a2e:0370:7334")); // true

Alternatives / Similar


ip
1,352 1.1.8 (7 months ago) Aug 15 2012 compare
6,238 8.1.0 (a month ago) Nov 13 2013 compare
6,223 0.1.3 (6 months ago) Jun 18 2013 compare

Other Languages

1,084 0.5.0 (4 months ago) Dec 28 2012 compare
url
80 v2.0.2 (9 days ago) Apr 15 2018 compare