UNPKG

parallelo

Version:

A lightweight utility library for running asynchronous tasks in parallel with controlled concurrency and result tracking.

13 lines (11 loc) 259 B
declare function parallelo<T, R>(items: T[], concurrency: number, fn: (item: T) => Promise<R> | R): Promise<{ results: { item: T; result: R; }[]; errors: { item: T; error: Error; }[]; }>; export { parallelo };