Is there a method for printing to the console without a trailing newline? The console
object documentation doesn\'t say anything regarding that:
I got the following error when using strict mode:
Node error: "Octal literals are not allowed in strict mode."
The following solution works (source):
process.stdout.write("received: " + bytesReceived + "\x1B[0G");
There seem to be many answers suggesting:
process.stdout.write
Error logs should be emitted on:
process.stderr
Instead use:
console.error
For anyone who is wonder why process.stdout.write('\033[0G');
wasn't doing anything it's because stdout
is buffered and you need to wait for drain
event (more info).
If write returns false
it will fire a drain
event.