mapAsync es-toolkit
Transforms each element in an array using an async function and returns a new array.
Reference
mapAsync(array, callback, options?)
Use mapAsync to perform async transformation operations for each element in an array. It's useful when you need to process each element asynchronously, such as API calls or database queries.
The concurrency option allows you to limit concurrent executions to control server load or respect API rate limits. If not specified, all operations run concurrently.
Parameters
The array to transform.
An async function that transforms each element.
Options to control concurrency.
concurrency(number, optional): Maximum number of concurrent operations. If not specified, all operations run concurrently.
Returns
A promise that resolves to a new array of transformed values.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.