JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4164
  • Score
    100M100P100Q155208F
  • License BSD-2-Clause

Get an array of IP addresses for a given CIDR range

Package Exports

  • cidr-range

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cidr-range) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.

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