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

bin-v8-flags-filter

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bin-v8-flags-filter - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

45

index.js

@@ -31,6 +31,4 @@ var spawn = require('child_process').spawn;

module.exports = function (cliPath, opts) {
var useShutdownMessage = opts && opts.useShutdownMessage;
var forcedKillDelay = opts && opts.forcedKillDelay || DEFAULT_FORCED_KILL_DELAY;
var args = [cliPath];
function getChildArgs (cliPath) {
var args = [cliPath];

@@ -55,2 +53,27 @@ process.argv.slice(2).forEach(function (arg) {

return args;
}
function setupSignalHandler (signal, childProcess, useShutdownMessage, forcedKillDelay) {
function forceKill () {
childProcess.kill('SIGTERM');
}
function handler () {
if (useShutdownMessage)
childProcess.send('shutdown');
else
childProcess.kill(signal);
setTimeout(forceKill, forcedKillDelay).unref();
}
process.on(signal, handler);
}
module.exports = function (cliPath, opts) {
var useShutdownMessage = opts && opts.useShutdownMessage;
var forcedKillDelay = opts && opts.forcedKillDelay || DEFAULT_FORCED_KILL_DELAY;
var args = getChildArgs(cliPath);
var cliProc = spawn(process.execPath, args, { stdio: [process.stdin, process.stdout, process.stderr, useShutdownMessage ? 'ipc' : null] });

@@ -70,15 +93,5 @@

process.on('SIGINT', function () {
function forceKill () {
cliProc.kill('SIGTERM');
}
setupSignalHandler('SIGINT', cliProc, useShutdownMessage, forcedKillDelay);
setupSignalHandler('SIGBREAK', cliProc, useShutdownMessage, forcedKillDelay);
if (useShutdownMessage)
cliProc.send('shutdown');
else
cliProc.kill('SIGINT');
setTimeout(forceKill, forcedKillDelay).unref();
});
if (useShutdownMessage) {

@@ -85,0 +98,0 @@ process.on('message', function (message) {

{
"name": "bin-v8-flags-filter",
"version": "1.1.1",
"version": "1.1.2",
"description": "Filters out v8 flags for your Node.js CLIs.",

@@ -5,0 +5,0 @@ "main": "index.js",

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