@code-like-a-carpenter/parallel
TypeScript icon, indicating that this package has built-in type declarations

3.2.5 • Public • Published

@code-like-a-carpenter/parallel

standard-readme compliant

Helpers for running async tasks in parallel

Table of Contents

Install

npm i @code-like-a-carpenter/parallel

Usage

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 uses Promise.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.

Maintainer

Ian Remmel

Contributing

Please see contributing guidelines at the project homepage.

License

MIT © Ian Remmel 2023 until at least now

Readme

Keywords

none

Package Sidebar

Install

npm i @code-like-a-carpenter/parallel

Weekly Downloads

19

Version

3.2.5

License

MIT

Unpacked Size

60.8 kB

Total Files

21

Last publish

Collaborators

  • ianwremmel