![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@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
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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.