1

So Im getting the input when someone types something in the console like this:

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', (text) => {
//code
});

using node.js. But whenever you type something in console and press enter it puts what you typed in there and I want to disable that. How do I do that?

(Btw I got that code from another stackoverflow post bc I know nothing about process.stdin so thats why Im asking if this is straight forward )

Anonymous
  • 47
  • 5
  • Can you provide some more details/examples on your expected behavior and current behavior? – Michael M. Oct 02 '22 at 23:48
  • So when I type something like 'okay' then press enter, it sends that to the code and also echos 'okay' in the console. But I want it to not write/echo what I wrote into tthe console. @MichaelM. – Anonymous Oct 02 '22 at 23:53
  • Does this answer your question? [How to hide password in the nodejs console?](https://stackoverflow.com/questions/24037545/how-to-hide-password-in-the-nodejs-console) – Christopher Oct 03 '22 at 00:30

0 Answers0