NodeJS Interacting with Console
The most important methods provided by the console module are console.log, console.error and console.time. But there are several others like console.info.
The parameters will be printed to the standard output (stdout) with a new line.
The parameters will be printed to the standard error (stderr) with a new line.
console.time starts a timer with an unique lable that can be used to compute the duration of an operation. When you call console.timeEnd with the same label, the timer stops and it prints the elapsed time in milliseconds to stdout.
It is possible to use the process module to write directly into the standard output of the console. Therefore it exists the method process.stdout.write. Unlike console.log this method does not add a new line before your output.
So in the following example the method is called two times, but no new line is added in between their outputs.
One can use terminal (control) codes to issue specific commands like switching colors or positioning the cursor.