I need to get only 1 keypress, i tried using iohook, but it didn't work
var stdin = process.openStdin();
process.stdin.setRawMode(true);
function d() {
return new Promise((res, rej) => {
stdin.on('keypress', function (chunk, key) {
res(key);
});
})
}
d().then(d => {
console.log(d);
})