Created
July 3, 2014 13:02
-
-
Save alfredwesterveld/442f2c0f1143ed6e9a6f to your computer and use it in GitHub Desktop.
node-sigint
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
| "use strict" | |
| const readLine = require ("readline") | |
| const options = { | |
| input: process.stdin, | |
| output: process.stdout | |
| } | |
| const rl = readLine.createInterface (options) | |
| const onSIGINT = function () { | |
| console.log('sigint') | |
| process.exit() // just exit like normally | |
| } | |
| rl.on ("SIGINT", onSIGINT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment