Skip to content


MIT 79 1 1,436
107.7 million (month) Aug 15 2012 2.0.1(a month ago)
6,615 2 22 MIT
9.0.0(a month ago) Nov 13 2013 57.5 million (month)

The "ip" library is a Node.js library that provides utility functions for working with IP addresses. It provides functions for parsing, validating, and converting IP addresses between different formats.

The "ip" library provides a simple and easy-to-use interface for working with IP addresses in Node.js. It can be useful in a variety of contexts, such as when creating a network-related application or when working with IP addresses in a web application.

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 ip = require('ip');

// check IP validity:
console.log(ip.isV4Format('')); // true
console.log(ip.isV4Format('2001:0db8:85a3:0000:0000:8a2e:0370:7334')); // false

// check subnets
console.log(ip.cidrSubnet('')); // { networkAddress: '', broadcastAddress: '' }
console.log(ip.not('')); // ''
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