1.1.0 • Published 6 years ago

forever-process v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Forver process

forever-process makes sure that your child process scripts will run forever.

Simple usage

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

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

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago