The type of elements in the input array
The type of elements in the result array
The input array to map over
The async function to apply to each element
Optionaloptions: { concurrency?: number; signal?: AbortSignal } = {}Optional configuration
Optionalconcurrency?: numberMaximum number of concurrent operations
Optionalsignal?: AbortSignalAbortSignal to cancel processing. When aborted, the promise rejects with an AbortError.
Promise resolving to an array of mapped results.
// Basic usage
const numbers = [1, 2, 3, 4];
const doubled = await asyncMap(numbers, async (n) => n * 2);
// Result: [2, 4, 6, 8]
Maps over an array with an asynchronous callback function and returns a promise that resolves to an array of results. Rejects on the first error.
For collecting errors instead of failing fast, use asyncMapSettled.