Socket
Socket
Sign inDemoInstall

cluster-service

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cluster-service - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

39

lib/commands/workers.js

@@ -1,4 +0,15 @@

module.exports = function(evt, cb) {
module.exports = function(evt, cb, cmd) {
var workers = evt.service.workers;
var ret = { workers: workers };
var ret = { };
cmd = cmd || "simple";
switch (cmd) {
case "details":
ret.workers = workers;
break;
default:
ret.workers = workerSummary(workers);
break;
}
cb(null, ret);

@@ -9,5 +20,25 @@ };

cb(null, {
command: "workers",
info: "Returns list of active worker processes."
command: "workers [simple|details]",
info: "Returns list of active worker processes.",
"simple|details": "Defaults to 'simple'.",
"* simple": "Simple overview of running workers.",
"* details": "Full details of running workers."
});
};
function workerSummary(workers) {
var ret = [];
for (var i = 0; i < workers.length; i++) {
var w = workers[i];
ret.push({
id: w.id,
pid: w.pid,
state: w.state,
worker: w.cservice.worker,
cwd: w.cservice.cwd
});
}
return ret;
}
var
cservice = require("../cluster-service")
cservice = require("../cluster-service")
;

@@ -20,2 +20,5 @@

if (cservice.options.cli === true && cservice.options.debug) {
process.stdout.clearLine();
process.stdout.cursorTo(0);
var args = Array.prototype.slice.call(arguments);

@@ -38,2 +41,5 @@ for (var i = 0; i < args.length; i++) {

if (cservice.options.cli === true && cservice.options.log) {
process.stdout.clearLine();
process.stdout.cursorTo(0);
var args = Array.prototype.slice.call(arguments);

@@ -51,2 +57,5 @@ if (args.length > 0 && typeof args[0] === "string" && args[0][0] === "{") {

if (cservice.options.cli === true && cservice.options.error) {
process.stdout.clearLine();
process.stdout.cursorTo(0);
var args = Array.prototype.slice.call(arguments);

@@ -53,0 +62,0 @@ for (var i = 0; i < args.length; i++) {

2

package.json
{
"name": "cluster-service",
"version": "0.5.4",
"version": "0.5.5",
"author": {

@@ -5,0 +5,0 @@ "name": "Aaron Silvas",

@@ -27,3 +27,3 @@ var cservice = require("../cluster-service");

assert.equal(obj.info, "Returns list of active worker processes.");
assert.equal(obj.command, "workers");
assert.equal(obj.command, "workers [simple|details]");
done();

@@ -30,0 +30,0 @@ };

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc