I use process.stdin.setEncoding('utf8');
But when i listen a event 'data'
, the text isn't egal.
process.stdin.on('data', function (text) {
if (text === 'q') console.log('ouiiiiiiiiii');
else console.log(text);
});
I type 'q' but don't display "ouiiiiiiiii", and the text is q... but the text === 'q'
is to false, why ? thanks
I think it's due to the encoding, but i don't know.