Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including cidr-range with all npm packages installed. Try it out:

var cidrRange = require("cidr-range")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

cidr-range v2.0.0

Get an array of IP addresses for a given CIDR range


Get an array of IP addresses for a given CIDR range

Note: If you need IPv6 support, check out cidr-tools's expand method.


$ npm install --save cidr-range


var cidrRange = require('cidr-range');

//=> [ '', '', '', '' ]


cidrRange(cidr, [options])

  • cidr {String} The IP address in CIDR notation. Required.
  • options {Object} Options object.


  • onlyHosts {Boolean} Whether the network and broadcast addresses should be excluded. Only works for /30 and below. Default: false.

© 2015 silverwind, distributed under BSD licence


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free