https://github.com/lestoni/cpcycle
Observe Child Processes life cycle events
https://github.com/lestoni/cpcycle
child-process ipc notification trace
Last synced: 7 months ago
JSON representation
Observe Child Processes life cycle events
- Host: GitHub
- URL: https://github.com/lestoni/cpcycle
- Owner: lestoni
- License: mit
- Created: 2018-10-27T06:56:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-31T18:06:34.000Z (over 7 years ago)
- Last Synced: 2024-11-15T10:57:05.800Z (over 1 year ago)
- Topics: child-process, ipc, notification, trace
- Language: JavaScript
- Size: 27.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cpcycle
Small Utility To Observe NodeJS Child Processes life cycle events using notifications.

## Usage
```
npm i cpcycle
```
```
const childProcess = require("child_process");
const cpcycle = require("cpcycle")(/*Options*/);
let shell = cpcycle(childProcess.spawn, /*Optional Name*/);
shell("echo", ["it works"])
.stdout.on("data", (data)=> {
console.log(data.toString())
})
```
## API
### CPCYCLE(/*Options = {}*/)
Initialize Cycple
Options
- `trace`: true/false - Turn on/off tracing
- `events`: ["Close", "Stdout"] - Events to track
### cpcycle(ChildProcess.Method, /*Optional name*/)
Wrap a child process method and pass an optional name to identify it via notification
## License
MIT