MCPcopy
hub / github.com/Unitech/pm2 / list

Method list

lib/API.js:590–622  ·  view source on GitHub ↗

* Get list of all processes managed * * @param {Function} cb Callback

(opts, cb)

Source from the content-addressed store, hash-verified

588 * @param {Function} cb Callback
589 */
590 list (opts, cb) {
591 var that = this;
592
593 if (typeof(opts) == 'function') {
594 cb = opts;
595 opts = null;
596 }
597
598 that.Client.executeRemote('getMonitorData', {}, function(err, list) {
599 if (err) {
600 Common.printError(err);
601 return cb ? cb(Common.retErr(err)) : that.exitCli(conf.ERROR_EXIT);
602 }
603
604 if (opts && opts.rawArgs && opts.rawArgs.indexOf('--watch') > -1) {
605 var dayjs = require('dayjs');
606 function show() {
607 process.stdout.write('\x1b[2J');
608 process.stdout.write('\x1b[0f');
609 console.log('Last refresh: ', dayjs().format());
610 that.Client.executeRemote('getMonitorData', {}, function(err, list) {
611 UX.list(list, null);
612 });
613 }
614
615 show();
616 setInterval(show, 900);
617 return false;
618 }
619
620 return cb ? cb(null, list) : that.speedList(null);
621 });
622 }
623
624 /**
625 * Kill Daemon

Callers 15

startWebServerFunction · 0.80
showMethod · 0.80
doListMethod · 0.80
Extra.jsFile · 0.80
Dashboard.jsFile · 0.80
autoExitFunction · 0.80
Runtime4Docker.jsFile · 0.80
checkCompletionFunction · 0.80
CLI.jsFile · 0.80
cluster.mocha.jsFile · 0.80
programmatic.jsFile · 0.80

Calls 5

cbFunction · 0.85
showFunction · 0.85
exitCliMethod · 0.80
indexOfMethod · 0.80
speedListMethod · 0.80

Tested by

no test coverage detected