hotkeys in nodejs
let readline = require('readline');
readline.emitKeypressEvents(process.stdin);
process.stdin.on('keypress', (ch, key) => {
console.log('got "keypress"', ch, key);
if (key && key.ctrl && key.name == 'c') {
console.log('ctrl+c was pressed');
// do something usefull
}
});
process.stdin.setRawMode(true);
process.stdin.resume();