Prompt for a single character
npm install askcharacterPrompt for a single character
``js
import askcharacter from 'askcharacter';
console.log('Please enter a character:');
const char = await askcharacter(process.stdin);
console.log('You entered the following askcharacter:', char.toString());
`
The stream passed to askcharacter can be any kind of Readable stream.askcharacter
If it is a TTY, will temporarily remove all other 'data' and'readable' listeners from it, and set the TTY into raw mode if it has not
been in raw mode to begin with.
instead?Because read `does not work inside a Node.js REPL.
Apache-2.0