Helpers for running async tasks in parallel
npm install @code-like-a-carpenter/parallel
> Helpers for running async tasks in parallel
- Install
- Usage
- Maintainer
- Contributing
- License
``bash`
npm i @code-like-a-carpenter/parallel
`ts
import {parallelMap} from '@code-like-a-carpenter/parallel';
const result = await parallelMap([1, 2, 3], async (value) => {
return value * 2;
});
`
Note that exceptions are reported via captureException from@code-like-a-carpenter/telemetry, but since parallelMap usesPromise.allSettled` under the hood, they'll never be thrown. If you need to
handle errors, you can either do so one at a time in you callback or you can
iterate through the result and check for failures.
Please see contributing guidelines at the
project homepage.
MIT © Ian Remmel 2023 until at least now