How to read user input from terminal before pressing enter using node and javascript?
I have made a simple javascript application which uses process.stdin or readline to get user input, but I don't want the user to have to submit their input with enter/return. I'd like to read user input on keydown/keypress. Is this possible? How might I accomplish this? Thanks!
Requirements:
- javascript, node
- from terminal
- user not required to submit string with enter/return
Prefer:
- less libraries, more vanilla javascript
- handles any key: letters, numbers, arrow keys, modifiers