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

when-exit

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

when-exit - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

8

dist/node/interceptor.js
/* IMPORT */
import process from 'node:process';
import { IS_WINDOWS } from './constants.js';
import Signals from './signals.js';

@@ -20,3 +21,8 @@ /* MAIN */

if (signal) {
process.kill(process.pid, signal);
if (IS_WINDOWS && (signal !== 'SIGINT' && signal !== 'SIGTERM' && signal !== 'SIGKILL')) { // Windows doesn't support POSIX signals, but Node emulates these 3 signals for us
process.kill(process.pid, 'SIGTERM');
}
else {
process.kill(process.pid, signal);
}
}

@@ -23,0 +29,0 @@ };

2

package.json

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

"description": "Execute a function right before the process, or the browser's tab, is about to exit.",
"version": "2.1.1",
"version": "2.1.2",
"type": "module",

@@ -8,0 +8,0 @@ "main": "dist/node/index.js",

@@ -5,2 +5,3 @@

import process from 'node:process';
import {IS_WINDOWS} from './constants';
import Signals from './signals';

@@ -42,4 +43,12 @@ import type {Callback, Disposer} from '../types';

process.kill ( process.pid, signal );
if ( IS_WINDOWS && ( signal !== 'SIGINT' && signal !== 'SIGTERM' && signal !== 'SIGKILL' ) ) { // Windows doesn't support POSIX signals, but Node emulates these 3 signals for us
process.kill ( process.pid, 'SIGTERM' );
} else {
process.kill ( process.pid, signal );
}
}

@@ -46,0 +55,0 @@

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