A small library that will quit the process if a user presses the escape key.
const exitHandler = require('exit-on-esc'); // initialize escape handler. exitHandler();
Install it using your favorite package manager!
$ npm install exit-on-esc