Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

forever

Package Overview
Dependencies
Maintainers
0
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forever - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

50

lib/forever.js

@@ -19,2 +19,3 @@ /*

nconf = require('nconf'),
mkdirp = require('mkdirp').mkdirp,
portfinder = require('portfinder'),

@@ -283,3 +284,3 @@ timespan = require('timespan'),

//
forever.stop = function (target, format, restart) {
forever.stop = function (target, format) {
var emitter = new events.EventEmitter(),

@@ -301,3 +302,3 @@ results = [];

process.nextTick(function () {
emitter.emit('stop', forever.format(format, processes));
emitter.emit('stop', forever.format(format, procs));
});

@@ -730,9 +731,4 @@ }

function getAllProcesses (callback) {
var results = [],
sockPath = forever.config.get('sockPath'),
sockets = fs.readdirSync(sockPath);
if (sockets.length === 0) {
return callback();
}
var sockPath = forever.config.get('sockPath'),
results = [];

@@ -768,8 +764,38 @@ function getProcess (name, next) {

async.forEach(sockets, getProcess, function () {
callback(results);
});
getSockets(sockPath, function (err, sockets) {
if (err || (sockets && sockets.length === 0)) {
return callback(err);
}
async.forEach(sockets, getProcess, function () {
callback(results);
});
})
};
//
// ### function getSockets (sockPath, callback)
// #### @sockPath {string} Path in which to look for UNIX domain sockets
// #### @callback {function} Continuation to pass control to when complete
// Attempts to read the files from `sockPath` if the directory does not exist,
// then it is created using `mkdirp`.
//
function getSockets (sockPath, callback) {
try {
var sockets = fs.readdirSync(sockPath);
}
catch (ex) {
if (ex.code !== 'ENOENT') {
return callback(ex);
}
return mkdirp(sockPath, 0755, function (err) {
return err ? callback(err) : callback(null, []);
});
}
callback(null, sockets);
}
//
// ### function getAllPids ()

@@ -776,0 +802,0 @@ // Returns the set of all pids managed by forever.

@@ -5,3 +5,3 @@ {

"description": "A simple CLI tool for ensuring that a given node script runs continuously (i.e. forever)",
"version": "0.6.2",
"version": "0.6.3",
"author": "Charlie Robbins <charlie.robbins@gmail.com>",

@@ -34,2 +34,3 @@ "contributors": [

"daemon": "0.3.x",
"mkdirp": "0.x.x",
"nconf": "0.x.x",

@@ -36,0 +37,0 @@ "optimist": "0.2.x",

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