
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
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 186,230 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.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.