UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

11 lines (8 loc) 284 B
import { limitAsync } from './limitAsync.mjs'; async function forEachAsync(array, callback, options) { if (options?.concurrency != null) { callback = limitAsync(callback, options.concurrency); } await Promise.all(array.map(callback)); } export { forEachAsync };