forever-monitor 
The core monitoring functionality of forever without the CLI
Usage
You can also use forever from inside your own node.js code.
Spawning a non-node process
You can spawn non-node processes too. Either set the command
key in the options
hash or pass in an Array
in place of the file
argument like this:
Options available when using Forever in node.js
There are several options that you should be aware of when using forever. Most of this configuration is optional.
Events available when using an instance of Forever in node.js
Each forever object is an instance of the node.js core EventEmitter. There are several core events that you can listen for:
error [err]: Raised when an error occurs
start [process, data]: Raised when the target script is first started.
stop [process]: Raised when the target script is stopped by the user
restart [forever]: Raised each time the target script is restarted
exit [forever]: Raised when the target script actually exits (permenantly).
stdout [data]: Raised when data is received from the child process' stdout
stderr [data]: Raised when data is received from the child process' stderr