2.0.0 • Published 6 years ago

cidr-range v2.0.0

Weekly downloads
4,387
License
BSD-2-Clause
Repository
github
Last release
6 years ago

cidr-range

npm.io npm.io npm.io

Get an array of IP addresses for a given CIDR range

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

Installation

$ npm install --save cidr-range

Example

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

cidrRange('1.2.3.4/30');
//=> [ '1.2.3.4', '1.2.3.5', '1.2.3.6', '1.2.3.7' ]

API

cidrRange(cidr, options)

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

Options

  • 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

2.0.0

6 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.0

9 years ago

0.1.0

9 years ago