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

Use signal-exit package to detect exit instead of process.on('exit') #29

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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