Socket
Book a DemoInstallSign in
Socket

evented-forever

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

evented-forever

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

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

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

cli

FAQs

Package last updated on 02 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts