
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
@vates/async-each
Advanced tools
Run async fn for each item in (async) iterable
Installation of the npm package:
> npm install --save @vates/async-each
asyncEach(iterable, iteratee, [opts])
Executes iteratee
in order for each value yielded by iterable
.
Returns a promise wich rejects as soon as a call to iteratee
throws or a promise returned by it rejects, and which resolves when all promises returned by iteratee
have resolved.
iterable
must be an iterable or async iterable.
iteratee
is called with the same this
value as asyncEach
, and with the following arguments:
value
: the value yielded by iterable
index
: the 0-based index for this valueiterable
: the iterable itselfopts
is an object that can contains the following options:
concurrency
: a number which indicates the maximum number of parallel call to iteratee
, defaults to 10
. The value 0
means no concurrency limit.signal
: an abort signal to stop the iterationstopOnError
: wether to stop iteration of first error, or wait for all calls to finish and throw an AggregateError
, defaults to true
import { asyncEach } from '@vates/async-each'
const contents = []
await asyncEach(
['foo.txt', 'bar.txt', 'baz.txt'],
async function (filename, i) {
contents[i] = await readFile(filename)
},
{
// reads two files at a time
concurrency: 2,
}
)
Contributions are very welcomed, either on the documentation or on the code.
You may:
FAQs
Run async fn for each item in (async) iterable
The npm package @vates/async-each receives a total of 69 weekly downloads. As such, @vates/async-each popularity was classified as not popular.
We found that @vates/async-each demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.