Socket
Socket
Sign inDemoInstall

nodemon

Package Overview
Dependencies
Maintainers
1
Versions
253
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodemon - npm Package Compare versions

Comparing version 2.0.12 to 2.0.13-alpha.1

.vscode/settings.json

132

lib/monitor/run.js

@@ -19,3 +19,3 @@ var debug = require('debug')('nodemon:run');

var signals = require('./signals');
const osRelease = parseInt(require('os').release().split(".")[0], 10);
const osRelease = parseInt(require('os').release().split('.')[0], 10);

@@ -71,3 +71,3 @@ function run(options) {

stdio: stdio,
}
};

@@ -81,8 +81,11 @@ var executable = cmd.executable;

if (executable.indexOf('/') !== -1) {
executable = executable.split(' ').map((e, i) => {
if (i === 0) {
return path.normalize(e);
}
return e;
}).join(' ');
executable = executable
.split(' ')
.map((e, i) => {
if (i === 0) {
return path.normalize(e);
}
return e;
})
.join(' ');
}

@@ -117,3 +120,3 @@ // taken from npm's cli: https://git.io/vNFD4

executable === 'node' && // only fork if node
utils.version.major > 4 // only fork if node version > 4
utils.version.major > 4; // only fork if node version > 4

@@ -132,3 +135,3 @@ if (shouldFork) {

utils.log.detail('forking');
debug('fork', sh, shFlag, args)
debug('fork', sh, shFlag, args);
} else {

@@ -189,4 +192,5 @@ utils.log.detail('spawning');

if (code === 127) {
utils.log.error('failed to start process, "' + cmd.executable +
'" exec not found');
utils.log.error(
'failed to start process, "' + cmd.executable + '" exec not found'
);
bus.emit('error', code);

@@ -236,3 +240,4 @@ process.exit();

if (code === 0) { // clean exit - wait until file change to restart
if (code === 0) {
// clean exit - wait until file change to restart
if (runCmd) {

@@ -251,4 +256,5 @@ utils.log.status('clean exit - waiting for changes before restart');

} else {
utils.log.fail('app crashed - waiting for file changes before' +
' starting...');
utils.log.fail(
'app crashed - waiting for file changes before' + ' starting...'
);
child = null;

@@ -278,3 +284,3 @@ }

if (hasStdio) {
child.stdin.on('error', () => { });
child.stdin.on('error', () => {});
process.stdin.pipe(child.stdin);

@@ -285,6 +291,9 @@ } else {

} else {
utils.log.error('running an unsupported version of node ' +
process.version);
utils.log.error('nodemon may not work as expected - ' +
'please consider upgrading to LTS');
utils.log.error(
'running an unsupported version of node ' + process.version
);
utils.log.error(
'nodemon may not work as expected - ' +
'please consider upgrading to LTS'
);
}

@@ -294,3 +303,4 @@ }

bus.once('exit', function () {
if (child && process.stdin.unpipe) { // node > 0.8
if (child && process.stdin.unpipe) {
// node > 0.8
process.stdin.unpipe(child.stdin);

@@ -314,4 +324,7 @@ }

utils.log.status(`still waiting for ${pids.length} sub-process${
pids.length > 2 ? 'es' : ''} to finish...`);
utils.log.status(
`still waiting for ${pids.length} sub-process${
pids.length > 2 ? 'es' : ''
} to finish...`
);
setTimeout(() => waitForSubProcesses(pid, callback), 1000);

@@ -322,3 +335,2 @@ });

function kill(child, signal, callback) {
if (!callback) {

@@ -333,5 +345,5 @@ callback = noop;

} catch (e) {
utils.log.error("Could not shutdown sub process cleanly");
utils.log.error('Could not shutdown sub process cleanly');
}
}
};

@@ -342,3 +354,2 @@ // We are handling a 'SIGKILL' POSIX signal under Windows the

if (signal === 'SIGKILL' || osRelease < 10) {
debug('terminating process group by force: %s', child.pid);

@@ -355,31 +366,32 @@

// We are using the Windows Management Instrumentation Command-line
// (wmic.exe) to resolve the sub-child process identifier, because the
// 'child' process in this context is actually a cmd.exe wrapper.
// We want to send the termination signal directly to the node process.
// The '2> nul' silences the no process found error message.
const resultBuffer = execSync(
`wmic process where (ParentProcessId=${child.pid}) get ProcessId 2> nul`
);
const result = resultBuffer.toString().match(/^[0-9]+/m);
try {
// We are using the Windows Management Instrumentation Command-line
// (wmic.exe) to resolve the sub-child process identifier, because the
// 'child' process in this context is actually a cmd.exe wrapper.
// We want to send the termination signal directly to the node process.
// The '2> nul' silences the no process found error message.
const resultBuffer = execSync(
`wmic process where (ParentProcessId=${child.pid}) get ProcessId 2> nul`
);
const result = resultBuffer.toString().match(/^[0-9]+/m);
// If there is no sub-child process we fall back to the child process.
const processId = Array.isArray(result) ? result[0] : child.pid;
// If there is no sub-child process we fall back to the child process.
const processId = Array.isArray(result) ? result[0] : child.pid;
debug('sending kill signal SIGINT to process: %s', processId);
debug('sending kill signal SIGINT to process: %s', processId);
// We are using the standalone 'windows-kill' executable to send the
// standard POSIX signal 'SIGINT' to the node process. This fixes #1720.
const windowsKill = path.normalize(
`${__dirname}/../../bin/windows-kill.exe`
);
// We are using the standalone 'windows-kill' executable to send the
// standard POSIX signal 'SIGINT' to the node process. This fixes #1720.
const windowsKill = path.normalize(
`${__dirname}/../../bin/windows-kill.exe`
);
// We have to detach the 'windows-kill' execution completely from this
// process group to avoid terminating the nodemon process itself.
// See: https://github.com/alirdn/windows-kill#how-it-works--limitations
//
// Therefore we are using 'start' to create a new cmd.exe context.
// The '/min' option hides the new terminal window and the '/wait'
// option lets the process wait for the command to finish.
try {
// We have to detach the 'windows-kill' execution completely from this
// process group to avoid terminating the nodemon process itself.
// See: https://github.com/alirdn/windows-kill#how-it-works--limitations
//
// Therefore we are using 'start' to create a new cmd.exe context.
// The '/min' option hides the new terminal window and the '/wait'
// option lets the process wait for the command to finish.
execSync(

@@ -392,3 +404,2 @@ `start "windows-kill" /min /wait "${windowsKill}" -SIGINT ${processId}`

callback();
} else {

@@ -415,3 +426,3 @@ // we use psTree to kill the full subtree of nodemon, because when

pids.sort().forEach(pid => exec(`kill -${sig} ${pid}`, noop));
pids.sort().forEach((pid) => exec(`kill -${sig} ${pid}`, noop));

@@ -422,5 +433,3 @@ waitForSubProcesses(child.pid, () => {

});
});
}

@@ -532,3 +541,5 @@ }

utils.log.detail('exiting');
if (child) { child.kill(); }
if (child) {
child.kill();
}
});

@@ -543,8 +554,9 @@

bus.emit('quit', 143);
if (child) { child.kill('SIGTERM'); }
if (child) {
child.kill('SIGTERM');
}
});
})
});
}
module.exports = run;

@@ -69,3 +69,4 @@ {

},
"version": "2.0.12",
"_version": "0.0.0-development",
"version": "2.0.13-alpha.1",
"funding": {

@@ -72,0 +73,0 @@ "type": "opencollective",

@@ -375,3 +375,3 @@ <p align="center">

<a href="https://www.najlepszeplatformyforex.pl/blog/broker-xtb/"><img style="margin: 12px; float: left" src="https://user-images.githubusercontent.com/13700/106011732-a72b2580-60b2-11eb-9d6a-24bf958de95d.png" width="120"></a>
<a href="https://www.auscasinos.com/new"><img style="margin: 12px; float: left" src="https://images.opencollective.com/auscasinos/8df0f47/logo/256.png" style="object-fit: contain; margin: 12px; margin-top:20px" height="120" width="120"></a><a href="https://www.casinoenvivo.com/blackjack"><img style="margin: 12px; float: left" src="https://images.opencollective.com/casino-en-vivo/1340a53/logo/256.png" style="object-fit: contain; margin: 12px; margin-top:20px" height="120" width="120"></a><a href="https://kasynohex.com/"><img src="https://images.opencollective.com/kasynohex-com/b25daf6/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://netticasinohex.com/"><img src="https://images.opencollective.com/netticasinohex-com/71d7417/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://aussiecasinohex.com/"><img src="https://images.opencollective.com/aussiecasinohex/923df37/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://hollandsegokken.nl/"><img src="https://images.opencollective.com/hollandsegokken-nl/7a3d90c/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://cryptocasinos.com/"><img src="https://images.opencollective.com/cryptocasinos/99b168e/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://mtltimes.ca/life/11-best-real-money-canadian-online-casinos-revealed-after-months-of-testing/"><img src="https://images.opencollective.com/mtl-times/b2736b8/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://www.casinoonlineaams.com/"><img src="https://images.opencollective.com/casinoonlineaamscom/da74236/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://slotokingua.com/"><img src="https://images.opencollective.com/slotoking-casino-ukraine/f4920ae/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://gamblizardcanada.com/free-spins/"><img src="https://images.opencollective.com/gamblizardcanada_com/1aa20b9/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://anbefaltcasino.com/"><img src="https://images.opencollective.com/anbefaltcasino-com/ab21410/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://www.bitcoinbuster.com/"><img src="https://images.opencollective.com/bitcoinbuster-com/858a895/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://www.eldinamo.cl/entretencion/2021/06/08/los-cinco-mejores-casinos-online-en-chile-para-2021/"><img src="https://images.opencollective.com/eldinamo/de50164/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://casinosters.com/minimum-deposit-casinos/"><img src="https://images.opencollective.com/casinosters-com/c7fbffd/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://www.elespectador.com/contenido-patrocinado/ruleta-en-vivo-en-espana-los-mejores-casinos-segun-su-popularidad/"><img src="https://images.opencollective.com/espectador/7cde7f5/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://www.casinotopp.net/sv/"><img src="https://images.opencollective.com/casinotopp-sverige/1dd399a/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://www.casinoutanlicens.io/"><img src="https://images.opencollective.com/casino-utan-svensk-licens2/a3efb14/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a>
<a href="https://www.auscasinos.com/new"><img style="margin: 12px; float: left" src="https://images.opencollective.com/auscasinos/8df0f47/logo/256.png" style="object-fit: contain; margin: 12px; margin-top:20px" height="120" width="120"></a><a href="https://www.casinoenvivo.com/blackjack"><img style="margin: 12px; float: left" src="https://images.opencollective.com/casino-en-vivo/1340a53/logo/256.png" style="object-fit: contain; margin: 12px; margin-top:20px" height="120" width="120"></a><a href="https://kasynohex.com/"><img src="https://images.opencollective.com/kasynohex-com/b25daf6/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://netticasinohex.com/"><img src="https://images.opencollective.com/netticasinohex-com/71d7417/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://aussiecasinohex.com/"><img src="https://images.opencollective.com/aussiecasinohex/923df37/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://hollandsegokken.nl/"><img src="https://images.opencollective.com/hollandsegokken-nl/7a3d90c/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://cryptocasinos.com/"><img src="https://images.opencollective.com/cryptocasinos/99b168e/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://mtltimes.ca/life/11-best-real-money-canadian-online-casinos-revealed-after-months-of-testing/"><img src="https://images.opencollective.com/mtl-times/b2736b8/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://www.casinoonlineaams.com/"><img src="https://images.opencollective.com/casinoonlineaamscom/da74236/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://slotokingua.com/"><img src="https://images.opencollective.com/slotoking-casino-ukraine/f4920ae/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://gamblizardcanada.com/free-spins/"><img src="https://images.opencollective.com/gamblizardcanada_com/1aa20b9/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://anbefaltcasino.com/"><img src="https://images.opencollective.com/anbefaltcasino-com/ab21410/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://www.bitcoinbuster.com/"><img src="https://images.opencollective.com/bitcoinbuster-com/858a895/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://www.eldinamo.cl/entretencion/2021/06/08/los-cinco-mejores-casinos-online-en-chile-para-2021/"><img src="https://images.opencollective.com/eldinamo/de50164/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://casinosters.com/10-minimum-deposit-casino/"><img alt=" uk casinos 10 pounds minimun deposit offers on casinosters" src="https://images.opencollective.com/casinosters-com/c7fbffd/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://www.elespectador.com/contenido-patrocinado/ruleta-en-vivo-en-espana-los-mejores-casinos-segun-su-popularidad/"><img src="https://images.opencollective.com/espectador/7cde7f5/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://www.casinotopp.net/sv/"><img src="https://images.opencollective.com/casinotopp-sverige/1dd399a/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a><a href="https://www.casinoutanlicens.io/"><img src="https://images.opencollective.com/casino-utan-svensk-licens2/a3efb14/logo/256.png" style="object-fit: contain; float: left; margin:12px" height="120" width="120"></a>

@@ -378,0 +378,0 @@ </div>

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