capture-exit
Advanced tools
Comparing version 1.2.0 to 2.0.0
{ | ||
"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 | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6209
39
0
+ Addedrsvp@4.8.5(transitive)
- Removedrsvp@3.6.2(transitive)
Updatedrsvp@^4.8.4