
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
parallel-es
Advanced tools
A JavaScript library to perform parallel JavaScript computations with ease (and other environments soon).
Install Parallel.es using npm:
npm install --save parallel-es
or yarn:
yarn add parallel-es
Performing a single computation in a background thread is as simple as calling a normal method:
import parallel from "parallel-es";
parallel.run(function () {
//… compute
return [1, 2, 3];
}).then(result => console.log(result));
Or use the reactive API to parallelize data stream based operations. The reactive API automatically splits the input array into sub-arrays, computes the sub-results in a web worker, and joins the resulting arrays:
parallel.range(0, 100000)
.map(value => value * value)
.then(result => console.log(result));
To show a progress update, use the subscribe method to register a callback that is invoked whenever a sub-result has been computed:
parallel.range(0, 100000)
.map(value => value * value)
.subscribe((subresult, taskIndex) => console.log(`The result of the task ${taskIndex} is`, subresult);)
.then(result => console.log(result));
For more detail, take a look at the API Documentation.
Parallel.es uses function serialization and, therefore, debugging is not supported out of the box (except if the debugger
statement is used. However, there is a webpack plugin that transpiles the program code and generates the needed source maps to enable debugging (at least in Chrome and Firefox Nightly).
Parallel.es uses function serialization and, therefore, the variables from the closure (outer scope) are no longer available when the function is invoked in the background thread. However, there is a webpack plugin that rewrites your code and allows you to use constant variables, and as well, functions defined in the outer scope of the task function. The plugin also exposes any used imports in the background thread.
The API Documentation is available online. The wiki describes the architecture in more detail. An academical description of the work is available here.
An example project using parallel-es and comparing its performance to related projects is parallel-es-example. The examples are hosted here.
![]() 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.
There exist other runtime systems with identical or similar goals. The report of the project thesis compares these runtime systems concerning applicability and runtime performance.
FAQs
Simple parallelization for EcmaScript
The npm package parallel-es receives a total of 229 weekly downloads. As such, parallel-es popularity was classified as not popular.
We found that parallel-es demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.