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

@ionic/utils-process

Package Overview
Dependencies
Maintainers
18
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ionic/utils-process - npm Package Compare versions

Comparing version 1.0.0-beta.1 to 1.0.0-beta.2

1

dist/index.d.ts

@@ -59,3 +59,2 @@ /// <reference types="node" />

export declare function offBeforeExit(fn: ExitFn): void;
export declare type Signal = 'process.exit' | NodeJS.Signals;
/**

@@ -62,0 +61,0 @@ * Asynchronous `process.exit()`, for running functions registered with

24

dist/index.js

@@ -111,6 +111,5 @@ "use strict";

exports.offBeforeExit = offBeforeExit;
const BEFORE_EXIT_SIGNALS = ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGBREAK'];
const beforeExitHandlerWrapper = (signal) => lodash.once(async () => {
debug(`onBeforeExit handler: ${signal} received`);
debug(`onBeforeExit handler: running ${exitFns.size} functions`);
debug('onBeforeExit handler: %O received', signal);
debug('onBeforeExit handler: running %O functions', exitFns.size);
await Promise.all([...exitFns.values()].map(async (fn) => {

@@ -124,7 +123,16 @@ try {

}));
debug(`onBeforeExit handler: exiting (exit code ${process.exitCode ? process.exitCode : 0})`);
process.exit();
if (signal !== 'process.exit') {
debug('onBeforeExit handler: killing self (exit code %O, signal %O)', process.exitCode ? process.exitCode : 0, signal);
process.removeListener(signal, BEFORE_EXIT_SIGNAL_LISTENERS[signal]);
process.kill(process.pid, signal);
}
});
for (const signal of BEFORE_EXIT_SIGNALS) {
process.on(signal, beforeExitHandlerWrapper(signal));
const BEFORE_EXIT_SIGNAL_LISTENERS = {
SIGINT: beforeExitHandlerWrapper('SIGINT'),
SIGTERM: beforeExitHandlerWrapper('SIGTERM'),
SIGHUP: beforeExitHandlerWrapper('SIGHUP'),
SIGBREAK: beforeExitHandlerWrapper('SIGBREAK'),
};
for (const [signal, fn] of lodash.entries(BEFORE_EXIT_SIGNAL_LISTENERS)) {
process.on(signal, fn);
}

@@ -139,3 +147,5 @@ const processExitHandler = beforeExitHandlerWrapper('process.exit');

await processExitHandler();
debug('processExit: exiting (exit code: %O)', process.exitCode);
process.exit();
}
exports.processExit = processExit;
{
"name": "@ionic/utils-process",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "Process utils for NodeJS",

@@ -39,4 +39,4 @@ "main": "dist/index.js",

"dependencies": {
"@ionic/utils-object": "1.0.0-beta.1",
"@ionic/utils-terminal": "1.0.0-beta.1",
"@ionic/utils-object": "1.0.0-beta.2",
"@ionic/utils-terminal": "1.0.0-beta.2",
"debug": "^4.0.0",

@@ -60,3 +60,3 @@ "lodash": "^4.17.5",

},
"gitHead": "ef8296bb16d44c6065b4467782a6a42ca0d5422f"
"gitHead": "d82bfdec8826557b816befcac1f220688e55f7ca"
}
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