Security News
Internet Archive Hacked, 31 Million Record Compromised
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
stream-worker
Advanced tools
Execute an async function per stream data event, pausing the stream when a concurrency limit is saturated
Execute an async function per stream data event, pausing the stream when a concurrency limit is saturated. Inspired by async.queue, optimized for streams.
Supports promises and callbacks.
npm install stream-worker
Requiring:
var streamWorker = require('stream-worker');
Promise style:
streamWorker(stream, 10, function(data) {
/* ... do some work with data ... */
return Promise.resolve();
})
.then(function() {
/* ... the stream is exhausted and all workers are finished ... */
}, function(err) {
/* ... there was an error processing the stream ... */
})
Callback style:
streamWorker(stream, 10,
function(data, done) {
/* ... do some work with data ... */
done(err);
},
function(err) {
/* ... the stream is exhauseted and all workers are finished ... */
}
);
streamWorker(stream, concurrencyLimit, work, done)
FAQs
Execute an async function per stream data event, pausing the stream when a concurrency limit is saturated
We found that stream-worker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
Security News
TC39 is meeting in Tokyo this week and they have approved nearly a dozen proposals to advance to the next stages.
Security News
Our threat research team breaks down two malicious npm packages designed to exploit developer trust, steal your data, and destroy data on your machine.