Skip to content

Instantly share code, notes, and snippets.

@alfredwesterveld
Created July 3, 2014 13:02
Show Gist options
  • Select an option

  • Save alfredwesterveld/442f2c0f1143ed6e9a6f to your computer and use it in GitHub Desktop.

Select an option

Save alfredwesterveld/442f2c0f1143ed6e9a6f to your computer and use it in GitHub Desktop.
node-sigint
"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