setEncoding ('utf8');
Well done Sebastian J. Above.
I had a โbuffer problemโ with several lines of test code that I had and added the encoding information and this solved it, see below.
Demonstrate problem
software
// process.stdin.setEncoding('utf8'); process.stdin.on('data', (data) => { console.log(typeof(data), data); });
entrance
hello world
exit
object <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64 0d 0a>
Demonstrate solution
software
process.stdin.setEncoding('utf8'); // <- Activate! process.stdin.on('data', (data) => { console.log(typeof(data), data); });
entrance
hello world
exit
string hello world
Ivan Dec 10 '18 at 9:56 2018-12-10 09:56
source share