forever.list
is a cli command, so you can not use directly in your code. If you are using forever programatically you should install forever-monitor.
So maybe you can call the cli command, e.g.:
var exec = require('child_process').exec;
function execute(command, callback) {
exec(command, function(err, stdout, stderr) {
callback(stdout);
})
};
execute('forever list', function(ret) {
console.log(ret);
});
out:
info: Forever processes running
data: uid command script forever pid logfile uptime
data: [0] OmsO /usr/bin/node /home/atupal/Dropbox/src/github/nodeblog/server.js 13171 13173 /home/atupal/.forever/OmsO.log 0:0:0:4.164