bin-v8-flags-filter
Advanced tools
Comparing version 1.1.0 to 1.1.1
10
index.js
@@ -57,3 +57,3 @@ var spawn = require('child_process').spawn; | ||
cliProc.on('exit', function (code, signal) { | ||
if (useShutdownMessage) | ||
if (useShutdownMessage && process.disconnect) | ||
process.disconnect(); | ||
@@ -70,2 +70,6 @@ | ||
process.on('SIGINT', function () { | ||
function forceKill () { | ||
cliProc.kill('SIGTERM'); | ||
} | ||
if (useShutdownMessage) | ||
@@ -76,5 +80,3 @@ cliProc.send('shutdown'); | ||
setTimeout(function () { | ||
cliProc.kill('SIGTERM'); | ||
}, forcedKillDelay); | ||
setTimeout(forceKill, forcedKillDelay).unref(); | ||
}); | ||
@@ -81,0 +83,0 @@ |
{ | ||
"name": "bin-v8-flags-filter", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Filters out v8 flags for your Node.js CLIs.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,4 +5,5 @@ var path = require('path'); | ||
var gracefulShutdown = process.argv.indexOf('--graceful-shutdown') > -1; | ||
var noIPCTest = process.argv.indexOf('--no-ipc-test') > -1; | ||
filter(path.join(__dirname, './actual-cli.js'), { useShutdownMessage: gracefulShutdown }); | ||
filter(path.join(__dirname, './actual-cli.js'), { useShutdownMessage: gracefulShutdown || noIPCTest }); | ||
@@ -50,1 +50,27 @@ var execFile = require('child_process').execFile; | ||
}); | ||
it('[Regression] Should not abort if using shutdown message and no parent IPC was established', function (done) { | ||
var args = [ | ||
path.join(__dirname, './cli.js'), | ||
'--hey', | ||
'--allow-natives-syntax', | ||
'-t=yo', | ||
'--trace-gc', | ||
'--no-ipc-test' | ||
]; | ||
var output = ''; | ||
var cliProcess = spawn(process.execPath, args, { stdio: 'pipe' }); | ||
cliProcess.stdout.on('data', function (data) { | ||
output += data.toString(); | ||
}); | ||
cliProcess.on('exit', function (code) { | ||
assert.equal(code, 0); | ||
assert.ok(output.indexOf('$$$ARGS:["--hey","-t=yo","--no-ipc-test"]$$$') > -1); | ||
assert.ok(output.indexOf('$$$ISSMI:true$$$') > -1); | ||
done(); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11018
151
3