https://github.com/hisco/forever-process
Make sure that your child process scripts will run forever.
https://github.com/hisco/forever-process
child-process forever javascript nodejs typescript
Last synced: 2 months ago
JSON representation
Make sure that your child process scripts will run forever.
- Host: GitHub
- URL: https://github.com/hisco/forever-process
- Owner: hisco
- License: mit
- Created: 2018-05-29T21:10:54.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-07T13:34:28.000Z (over 7 years ago)
- Last Synced: 2025-02-14T05:34:43.239Z (over 1 year ago)
- Topics: child-process, forever, javascript, nodejs, typescript
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/forever-process
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Forver process
`forever-process` makes sure that your child process scripts will run forever.
## Simple usage
```js
const {ForeverChildProcess} = require('forever-process');
const foreverChildProcess = new ForeverChildProcess();
foreverChildProcess.on('child' , (child)=>{
child.on('data' , (msg)=>{
console.log(msg.toString())
})
})
foreverChildProcess.fork(`${__dirname}/fail-process`);
```
## Advanced usage
```js
const {ForeverChildProcess} = require('forever-process');
const foreverChildProcess = new ForeverChildProcess({
//You can overide any of the following settings
fork : ()=>{ /* You can overide, just remeber to return the child instance */},
spawn : ()=>{ /* You can overide, just remeber to return the child instance */},
minUptime : 1000,
spinSleepTime : 30000,
spinIdentifyTime : 30000,
spinCounter : 8
});
foreverChildProcess.on('child' , (child)=>{
child.on('data' , (msg)=>{
console.log(msg.toString())
})
})
foreverChildProcess.fork(`${__dirname}/fail-process`);
```
## License
[MIT](LICENSE)