exit-on-esc 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(); Installation Install it using your favorite package manager! $ npm install exit-on-esc