Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

threads

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

threads - npm Package Compare versions

Comparing version 1.0.0-beta.3 to 1.0.0-beta.4

9

dist/master/implementation.node.js

@@ -71,2 +71,3 @@ "use strict";

: eval("require")("worker_threads").Worker;
let allWorkers = [];
class Worker extends NativeWorker {

@@ -82,2 +83,3 @@ constructor(scriptPath) {

this.mappedEventListeners = new WeakMap();
allWorkers.push(this);
}

@@ -96,2 +98,9 @@ addEventListener(eventName, rawListener) {

}
const terminateAll = () => {
allWorkers.forEach(worker => worker.terminate());
allWorkers = [];
};
// Take care to not leave orphaned processes behind. See #147.
process.on("SIGINT", () => terminateAll());
process.on("SIGTERM", () => terminateAll());
return Worker;

@@ -98,0 +107,0 @@ }

2

dist/worker/index.js

@@ -161,3 +161,3 @@ "use strict";

}
if (typeof process !== "undefined" && implementation_1.default.isWorkerRuntime()) {
if (typeof process !== "undefined" && typeof process.on === "function" && implementation_1.default.isWorkerRuntime()) {
process.on("uncaughtException", (error) => {

@@ -164,0 +164,0 @@ // Post with some delay, so the master had some time to subscribe to messages

{
"name": "threads",
"version": "1.0.0-beta.3",
"version": "1.0.0-beta.4",
"description": "Easy to use, yet powerful multi-threading library for node.js, web browsers and Electron",

@@ -25,3 +25,3 @@ "main": "dist/index.js",

},
"homepage": "https://github.com/andywer/threads.js#readme",
"homepage": "https://threads.js.org",
"keywords": [

@@ -28,0 +28,0 @@ "thread",

@@ -14,6 +14,6 @@ <h1 align="center">threads</h1>

* **Speed up** code by parallel processing
* **Keep UI responsive** by offloading work from rendering thread
* First-class support for **async functions** & **observables**
* Manage bulk task executions with **thread pools**
* Works great with **webpack**
* Allows using **require()** and **import**/**export** in workers

@@ -20,0 +20,0 @@ ### Version 0.x

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc