Neutrinos Peludos Magnéticos
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

evented-forever

0.0.1 • Public • Published

Evented Forever

Forever extended with an --eventFile option to catch events (stop, restart...) through a file with listeners.

Installation

  $ [sudo] npm install evented-forever -g

Example

  $ forever start --eventFile sendMeMailOnRestart.js yourApp.js

Then 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: 'crash@gmail.com',
      to: 'you@gmail.com',
      subject: 'Your app has crashed',
      text: 'Go fix your app!'
    });
  }

Available events: "error", "start", "stop", "restart", "exit", "stdout", "stderr". (more details here).

Keywords

none

install

npm i evented-forever

Downloadsweekly downloads

2

version

0.0.1

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability