Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
Use signal-exit package to detect exit instead of process.on('exit')
Browse files Browse the repository at this point in the history
Fixes #21
  • Loading branch information
jskorepa authored and isaacs committed Apr 13, 2018
1 parent f6527ea commit cf093e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lockfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function hasOwnProperty (obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop)
}

process.on('exit', function () {
var onExit = require('signal-exit')
onExit(function () {
debug('exit listener')
// cleanup
Object.keys(locks).forEach(exports.unlockSync)
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"directories": {
"test": "test"
},
"dependencies": {},
"dependencies": {
"signal-exit": "^3.0.2"
},
"devDependencies": {
"tap": "^7.1.2",
"touch": "0"
Expand Down

0 comments on commit cf093e6

Please sign in to comment.