
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
Async concurrent iterator (async forEach)
Like async.each(), but tiny.
I often use async.each() for doing async operations when iterating, but I almost never use the other gadzillion methods in async.
Async iteration is one of the most used async control flow patterns.
I would strongly recommend using promises instead. You could then use the built-in Promise.all(), or p-map if you need concurrency control.
$ npm install --save each-async
const eachAsync = require('each-async');
eachAsync(['foo','bar','baz'], (item, index, done) => {
console.log(item, index);
done();
}, error => {
console.log('finished');
});
//=> 'foo 0'
//=> 'bar 1'
//=> 'baz 2'
//=> 'finished'
Type: Array
Array you want to iterate.
Type: Function
Called for each item in the array with the following arguments:
item: the current item in the arrayindex: the current indexdone([error]): call this when you're done with an optional error. Supplying anything other than undefined/null will stop the iteration.Note that order is not guaranteed since each item is handled concurrently.
Type: Function
Called when the iteration is finished or on the first error. First argument is the error passed from done() in the callback.
MIT © Sindre Sorhus
The async package provides a wide range of utilities for working with asynchronous JavaScript. It includes functions for parallel and sequential execution, as well as error handling and control flow. Compared to each-async, async offers a more comprehensive set of tools for managing asynchronous operations.
Bluebird is a fully-featured Promise library for JavaScript. It provides powerful tools for managing asynchronous code, including methods for iterating over arrays with promises. Bluebird's `Promise.each` method offers similar functionality to each-async but with the added benefits of promise-based syntax and additional features.
The p-map package allows you to map over promises concurrently. It provides a simple and efficient way to handle asynchronous operations on arrays, with control over the concurrency level. Compared to each-async, p-map focuses on promise-based iteration and offers more control over concurrency.
FAQs
Async concurrent iterator (async forEach)
The npm package each-async receives a total of 157,820 weekly downloads. As such, each-async popularity was classified as popular.
We found that each-async demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.