supervisord-eventlistener

Listens for events from supervisord and emits them

node-supervisord-eventlistener

This library implements a Supervisord event listener for Node.js.

npm install supervisord-eventlistener

var supervisor = require("supervisord-eventlistener");
supervisor.on("event", function(typeheadersdata) {
    //Gets called for all events 
    console.error("Event type:", type);
    console.error("Headers:", headers);
    console.error("Data:", data);
});
supervisor.on("PROCESS_STATE_STOPPING", function(headersdata) {
    //Only called for PROCESS_STATE_STOPPING events 
    console.error("Process state stopping");
    console.error("Headers:", headers);
    console.error("Data:", data);
});
supervisor.listen(process.stdin, process.stdout);

List of event types: click here

See http://supervisord.org/events.html for more documentation.