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

capture-exit

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capture-exit - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

15

package.json
{
"name": "capture-exit",
"version": "1.2.0",
"version": "2.0.0",
"description": "safely cleanup in signal handlers",

@@ -24,10 +24,13 @@ "main": "index.js",

"devDependencies": {
"chai": "^3.5.0",
"execa": "0.4.0",
"mocha": "^3.1.2",
"ora": "^0.3.0"
"chai": "^4.2.0",
"execa": "1.0.0",
"mocha": "^5.2.0",
"ora": "^3.0.0"
},
"dependencies": {
"rsvp": "^3.3.3"
"rsvp": "^4.8.4"
},
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
}

@@ -15,1 +15,25 @@ # capture-exit

Differences between `process.on('exit')` and `captureExit.onExit(...)` => https://github.com/ember-cli/capture-exit/issues/12
### Installation
```sh
yarn add capture-exit
// or
npm install --save capture-exit
```
### Usage
```js
// as early in startup as possible
require('capture-exit').captureExit();
// when you want to schedule some work on exit:
function onExit() {
return something.processWillExit(); // you can return promises, which will pause exit until fulfilled
}
require('capture-exit').onExit(onExit); // add an exit handler
require('capture-exit').offExit(onExit); // allows one to remove an exit handle if it is not longer required
```
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