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

simple-nodejs-threader

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-nodejs-threader - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

6

package.json
{
"author": "Viktor Leandersson",
"name": "simple-nodejs-threader",
"version": "0.0.2",
"version": "0.0.3",
"description": "A simple collection of multi-threading helpers for NodeJs",

@@ -10,2 +10,6 @@ "keywords": [

"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/vleandersson/simple-nodejs-threader"
},
"main": "dist/bundle.js",

@@ -12,0 +16,0 @@ "types": "dist/index.d.ts",

@@ -16,3 +16,3 @@ # simple-nodejs-threader

1. Create a new Process manager
### Create a new Process manager

@@ -23,3 +23,3 @@ ```typescript

1. Create one or more processes that can run in parallel
### Create one or more processes that can run in parallel

@@ -46,3 +46,3 @@ ```typescript

1. Add processes to the manager queue
### Add processes to the manager queue

@@ -53,3 +53,3 @@ ```typescript

1. Await for completion
### Await for completion

@@ -76,1 +76,32 @@ ```typescript

```
## Attach external life-cycle hooks
### Example: nodemon
<https://github.com/remy/nodemon/blob/HEAD/doc/events.md#Using_nodemon_as_child_process>
```typescript
const frontendProcess = ProcessManager.promiseSpawn(
"nodemon",
["path/to/file.js", "--watch", "path/to/watch"],
{
stdio: ["pipe", "pipe", "pipe", "ipc"],
shell: true,
}
);
frontendProcess.child.on("message", (event) => {
if (event.type === "start") {
console.log("nodemon started");
} else if (event.type === "crash") {
console.log("script crashed for some reason");
}
});
// force a restart
frontendProcess.child.send("restart");
// force a quit
frontendProcess.child.send("quit");
```
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