You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

cidr-range

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cidr-range - npm Package Compare versions

Comparing version

to
2.0.0

12

cidr-range.js
"use strict";
var ip = require("ip");
const ip = require("ip");

@@ -14,8 +14,8 @@ module.exports = function cidrRange(cidr, opts) {

var range = ip.cidrSubnet(cidr);
var start = ip.toLong(range.networkAddress);
var end = ip.toLong(range.broadcastAddress);
var out = [];
const range = ip.cidrSubnet(cidr);
const start = ip.toLong(range.networkAddress);
const end = ip.toLong(range.broadcastAddress);
const out = [];
for (var i = start; i <= end; i++) {
for (let i = start; i <= end; i++) {
out.push(ip.fromLong(i));

@@ -22,0 +22,0 @@ }

{
"name": "cidr-range",
"version": "1.0.6",
"version": "2.0.0",
"description": "Get an array of IP addresses for a given CIDR range",

@@ -9,4 +9,7 @@ "author": "silverwind <me@silverwind.io> (https://github.com/silverwind)",

"main": "cidr-range.js",
"engines": {
"node": ">=6"
},
"scripts": {
"test": "mocha"
"test": "make test"
},

@@ -24,4 +27,9 @@ "files": [

"dependencies": {
"ip": "^1.1.3"
"ip": "^1.1.5"
},
"devDependencies": {
"eslint": "^4.19.1",
"eslint-config-silverwind": "^1.0.42",
"updates": "^3.0.0"
}
}

@@ -1,4 +0,7 @@

# cidr-range [![NPM version](https://img.shields.io/npm/v/cidr-range.svg?style=flat)](https://www.npmjs.org/package/cidr-range) [![Dependency Status](http://img.shields.io/david/silverwind/cidr-range.svg?style=flat)](https://david-dm.org/silverwind/cidr-range)
# cidr-range
[![](https://img.shields.io/npm/v/cidr-range.svg?style=flat)](https://www.npmjs.org/package/cidr-range) [![](https://img.shields.io/npm/dm/cidr-range.svg)](https://www.npmjs.org/package/cidr-range) [![](https://api.travis-ci.org/silverwind/cidr-range.svg?style=flat)](https://travis-ci.org/silverwind/cidr-range)
> Get an array of IP addresses for a given CIDR range
*Note: If you need IPv6 support, check out [cidr-tools](https://github.com/silverwind/cidr-tools)'s `expand` method.*
## Installation

@@ -5,0 +8,0 @@ ```