Last active
January 15, 2018 12:17
-
-
Save janbiasi/988106530cda7b83c0bb9b3f4e478a69 to your computer and use it in GitHub Desktop.
Handle node.js process quit by user (Command+Q on MacOS, Control+C on Windows)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['SIGINT', 'SIGTERM'].forEach(sig => { | |
process.on(sig, () => process.exit()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment