parallel.es

A JavaScript library that simplifies parallel computation in the browser (and other environments soon).
Getting Started
Install the library using npm:
npm install --save parallel-es
Perform a single computation on a worker thread:
import parallel from "parallel-es";
parallel.run(function () {
return [1, 2, 3];
}).then(result => console.log(result));
Or use the reactive api that automatically schedules the work onto multiple worker without any additional doing:
parallel.range(0, 100000)
.map(value => value * value)
.then(result => console.log(result));
Debugging Support
The Library uses Function serialization and therefore debugging is not supported out of the box. However, there is a webpack plugin that rewrites your code in a way that allows debugging (at least in Chrome and Firefox Nightly).
Referencing Functions and Variables
The library uses function serialization and therefore the outer scope is no longer available when the function is invoked in the worker thread. However, there is a webpack plugin that rewrites your code and allows you to use const variables from the outer scope or reference functions.
Documentation
The API Documentation is available online. The wiki describes the architecture and programing model in more detail.
Examples
More sophisticated examples can be seen here.
Browsers support made by @godban
 IE / Edge |  Firefox |  Chrome |  Safari |  Opera |  iOS Safari |  Android |
---|
IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | iOS 5.1, iOS 6, iOS 7, iOS 8, iOS 9 | Chrome, Android 4.4 |
Automated browser testing is performed using BrowserStack's open source offer.
