Skip to content


MIT 31 1 499
1.7 million (month) May 05 2015 9.0.5(2 months ago)
6,512 2 22 MIT
8.1.0(6 months ago) Nov 13 2013 50.7 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.

The query-string library is a Node.js library that provides a simple way to parse and stringify query strings. It is useful for working with the query string portion of a URL, which is the part of the URL that follows 'the "?" character and contains key-value pairs.

Example Use

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

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

// validate addresses:
console.log(IPAddress.isValid("")); // true
console.log(IPAddress.isValid("2001:0db8:85a3:0000:0000:8a2e:0370:7334")); // true
import queryString from 'query-string';

//=> '?foo=bar'

const parsed = queryString.parse(;
//=> {foo: 'bar'}

//=> '#token=bada55cafe'

const parsedHash = queryString.parse(location.hash);
//=> {token: 'bada55cafe'} = 'unicorn';
parsed.ilike = 'pizza';

const stringified = queryString.stringify(parsed);
//=> 'foo=unicorn&ilike=pizza' = stringified;
// note that `` automatically prepends a question mark
//=> '?foo=unicorn&ilike=pizza'

Alternatives / Similar