🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

ipterate

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

ipterate - npm Package Compare versions

Comparing version

to
1.0.2

7

lib/IpRange.js

@@ -19,2 +19,9 @@ 'use strict';

}
async iterateAsync(callback) {
let lastIp;
while (lastIp = this.subnet.nextIp(lastIp)) {
await callback(lastIp);
}
}
};

2

package.json
{
"name": "ipterate",
"version": "1.0.1",
"version": "1.0.2",
"description": " A small utility library to allow you to iterate through all IPs within a given subnet. Remains efficient no matter how many IPs there are in the range.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -34,4 +34,15 @@ # About

If you want to perform an asynchronous action, make sure that your function returns a promise and call `iterateAsync`
instead. `iterateAsync` itself returns a promise and will wait for the resolution of the promise returned by
your delegate, before it provides you with another IP.
const ipterate = require('ipterate');
const rp = require('request-promise');
ipterate.range('0.0.0.0/0').iterateAsync(ip => {
return rp.get(ip);
});
# Installation
npm install --save ipterate