dotfiles/.vscode/extensions/saviorisdead.RustyCode-0.18.0/node_modules/signal-exit/test/fixtures/sigint.js

12 lines
342 B
JavaScript
Raw Normal View History

2016-09-11 09:29:13 +01:00
var onSignalExit = require('../../')
onSignalExit(function (code, signal) {
console.log('exited with sigint, ' + code + ', ' + signal)
})
// For some reason, signals appear to not always be fast enough
// to come in before the process exits. Just a few ticks needed.
setTimeout(function () {}, 1000)
process.kill(process.pid, 'SIGINT')