evented-forever
v0.0.1
Published
Forever CLI extended with an "--eventFile" option to catch events (stop, restart...) through a file with listeners
Downloads
18
Readme
Evented Forever
Forever extended with an --eventFile option to catch events (stop, restart...) through a file with listeners.
Installation
$ [sudo] npm install evented-forever -gExample
$ forever start --eventFile sendMeMailOnRestart.js yourApp.jsThen create a file sendMailOnRestart.js with listeners:
//file sendMailOnRestart.js
var email = require('emailjs');
//define a listener for the "restart" event
exports.restart = function() {
email.server.connect({
user: 'crash',
password: 'password',
host: 'smtp.gmail.com'
}).send({
from: '[email protected]',
to: '[email protected]',
subject: 'Your app has crashed',
text: 'Go fix your app!'
});
}Available events: "error", "start", "stop", "restart", "exit", "stdout", "stderr". (more details here).
