Skip to content
tsdotnetPublic

About

A utility for automatically partitioning tasks (promises) and executing them in parallel using separate processes or web workers.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Repository files navigation

@tsdotnet/parallel: Spread the work, gather it. Run tasks in parallel workers.

npm version GitHub license

Run functions over data in parallel worker threads, in Node.js and the browser, with a synchronous fallback.

Install

npm install @tsdotnet/parallel

Usage

import { Parallel } from '@tsdotnet/parallel';

const squares = Parallel.map([1, 2, 3, 4], n => n * n);
squares.then(values => console.log(values)); // [1, 4, 9, 16]

Tasks run in worker threads, so each task function must be self-contained. Pass shared values with env and helper code with require.

Use it from

ESM (import { Parallel } from '@tsdotnet/parallel';) or CommonJS (const { Parallel } = require('@tsdotnet/parallel');). No <script> (UMD) build: use it with a bundler or Node.js.

Docs

tsdotnet.github.io/parallel

About

A utility for automatically partitioning tasks (promises) and executing them in parallel using separate processes or web workers.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages