Socket
Socket
Sign inDemoInstall

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 3.1.3 to 3.1.4

6

index.d.ts

@@ -59,3 +59,3 @@ /**

// Removing an exit hook:
const unsubscribe = asyncExitHook(() => {}, {});
const unsubscribe = asyncExitHook(() => {}, {minimumWait: 500});

@@ -81,3 +81,5 @@ unsubscribe();

console.log('Exiting');
}, 500);
}, {
minimumWait: 500
});

@@ -84,0 +86,0 @@ // Instead of `process.exit()`

{
"name": "exit-hook",
"version": "3.1.3",
"version": "3.1.4",
"description": "Run some code when the process exits",

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

@@ -55,7 +55,7 @@ # exit-hook

Type: `function(): void`
Type: `() => void`
The callback function to execute when the process exits.
### asyncExitHook(onExit, minimumWait)
### asyncExitHook(onExit, options)

@@ -68,2 +68,18 @@ Register a function to run during `gracefulExit`.

#### onExit
Type: `() => (void | Promise<void>)`
The callback function to execute when the process exits via `gracefulExit`, and will be wrapped in `Promise.resolve`.
#### options
Type: `object`
##### minimumWait
Type: `number`
The amount of time in milliseconds that the `onExit` function is expected to take.
```js

@@ -74,3 +90,5 @@ import {asyncExitHook} from 'exit-hook';

console.log('Exiting');
}, 300);
}, {
minimumWait: 300
});

@@ -96,16 +114,2 @@ throw new Error('🦄');

#### onExit
Type: `function(): void | Promise<void>`
The callback function to execute when the process exits via `gracefulExit`, and will be wrapped in `Promise.resolve`.
#### options
##### minimumWait
Type: `number`
The amount of time in milliseconds that the `onExit` function is expected to take.
### gracefulExit(signal?: number): void

@@ -112,0 +116,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