Socket
Socket
Sign inDemoInstall

ipterate

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc