Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (format) {
//
// Iterate over the procs to see which has the
// longest options string
//
procs.forEach(function (proc) {
rows.push(mapColumns('[' + index + ']', function (column) {
return forever.columns[column]
? forever.columns[column].get(proc)
: 'MISSING';
}));
index++;
});
formatted = cliff.stringifyRows(rows, mapColumns('white', function (column) {
return forever.columns[column]
? forever.columns[column].color
: 'white';
}));
}
return format ? formatted : procs;
};
if (format) {
//
// Iterate over the procs to see which has the
// longest options string
//
procs.forEach(function (proc) {
rows.push(mapColumns('[' + index + ']', function (column) {
return forever.columns[column]
? forever.columns[column].get(proc)
: 'MISSING';
}));
index++;
});
formatted = cliff.stringifyRows(rows, mapColumns('white', function (column) {
return forever.columns[column]
? forever.columns[column].color
: 'white';
}));
}
return format ? formatted : procs;
};
if (format) {
//
// Iterate over the procs to see which has the
// longest options string
//
procs.forEach(function (proc) {
rows.push(mapColumns('[' + index + ']', function (column) {
return forever.columns[column]
? forever.columns[column].get(proc)
: 'MISSING';
}));
index++;
});
formatted = cliff.stringifyRows(rows, mapColumns('white', function (column) {
return forever.columns[column]
? forever.columns[column].color
: 'white';
}));
}
return format ? formatted : procs;
};
return 1;
} else if (a.serverId < b.serverId) {
return -1;
} else if (a.serverId > b.serverId) {
return 1;
} else {
return 0;
}
};
servers.sort(comparer);
let rows: string[][] = [];
rows.push(['serverId', 'serverType', 'pid', 'rss(M)', 'heapTotal(M)', 'heapUsed(M)', 'uptime(m)']);
servers.forEach(function (server) {
rows.push([server.serverId, server.serverType, server.pid, server.rss, server.heapTotal, server.heapUsed, server.uptime]);
});
console.log(cliff.stringifyRows(rows, ['red', 'blue', 'green', 'cyan', 'magenta', 'white', 'yellow']));
process.exit(0);
});
});
load_plugins(nell_site, function(err) {
if (err) {
return done(err);
}
Object.keys(nell_site.plugins_desc).forEach(function(plugin) {
plugin = nell_site.plugins_desc[plugin];
rows.push([plugin.key, plugin.args, plugin.desc]);
});
console.log(cliff.stringifyRows(rows, ['red', 'blue', 'green']));
done(null);
});
}
.action(function() {
let rows = [
['Name', 'referenceUrl'],
].concat(_.keys(apis).map(function(name) {
return [name, apis[name].referenceUrl];
}));
console.log(cliff.stringifyRows(rows));
});
if (comd === 'modules') {
var msg = data.msg;
log('\n' + consts.MODULE_INFO);
log(data.msg + '\n');
return;
}
if (comd === 'status') {
var msg = data.msg;
var server = msg.body;
var rows = [];
rows.push(['time', 'serverId', 'serverType', 'pid', 'cpuAvg', 'memAvg', 'vsz', 'rss', 'usr', 'sys', 'gue']);
var color = getColor(rows[0].length);
if (server) {
rows.push([server['time'], server['serverId'], server['serverType'], server['pid'], server['cpuAvg'], server['memAvg'], server['vsz'], server['rss'], server['usr'], server['sys'], server['gue']]);
log('\n' + cliff.stringifyRows(rows, color) + '\n');
} else {
log('\n' + consts.STATUS_ERROR + '\n');
}
return;
}
if (comd === 'config' || comd === 'components' || comd === 'settings' || comd === 'get' || comd === 'set' || comd === 'exec' || comd === 'run') {
log('\n' + cliff.inspect(data) + '\n');
return;
}
if (comd === 'stop') {
return
}
if (comd === 'add') {
var help = function() {
var HELP_INFO_1 = consts.HELP_INFO_1;
for (var i = 0; i < HELP_INFO_1.length; i++) {
util.log(HELP_INFO_1[i]);
}
var COMANDS_ALL = consts.COMANDS_ALL;
util.log(cliff.stringifyRows(COMANDS_ALL));
var HELP_INFO_2 = consts.HELP_INFO_2;
for (var i = 0; i < HELP_INFO_2.length; i++) {
util.log(HELP_INFO_2[i]);
}
}
function help(rl) {
var HELP_INFO_1 = consts.HELP_INFO_1;
for (var i = 0; i < HELP_INFO_1.length; i++) {
util.log(HELP_INFO_1[i]);
}
var COMANDS_ALL = consts.COMANDS_ALL;
util.log(cliff.stringifyRows(COMANDS_ALL));
var HELP_INFO_2 = consts.HELP_INFO_2;
for (var i = 0; i < HELP_INFO_2.length; i++) {
util.log(HELP_INFO_2[i]);
}
rl.prompt();
}
function help() {
var HELP_INFO_1 = consts.HELP_INFO_1;
for (var i = 0; i < HELP_INFO_1.length; i++) {
util.log(HELP_INFO_1[i]);
}
var COMANDS_ALL = consts.COMANDS_ALL;
util.log(cliff.stringifyRows(COMANDS_ALL));
var HELP_INFO_2 = consts.HELP_INFO_2;
for (var i = 0; i < HELP_INFO_2.length; i++) {
util.log(HELP_INFO_2[i]);
}
}