🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

exit-hook

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exit-hook - npm Package Compare versions

Comparing version

to
1.1.1

17

index.js
'use strict';
var cbs = [];
var called = false;
function exit(sig) {
function exit(exit, signal) {
if (called) {
return;
}
called = true;
cbs.forEach(function (el) {

@@ -10,4 +17,4 @@ el();

if (sig) {
process.exit(128);
if (exit === true) {
process.exit(128 + signal);
}

@@ -21,5 +28,5 @@ };

process.once('exit', exit);
process.once('SIGINT', exit.bind(null, true));
process.once('SIGTERM', exit.bind(null, true));
process.once('SIGINT', exit.bind(null, true, 2));
process.once('SIGTERM', exit.bind(null, true, 15));
}
};
{
"name": "exit-hook",
"version": "1.1.0",
"version": "1.1.1",
"description": "Run some code when the process exits",

@@ -5,0 +5,0 @@ "license": "MIT",