The most important methods provided by the console module are
console.time. But there are several others like
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.error('Oh, sorry, there is an error.');
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
It is possible to use the process module to write directly into the standard output of the console. Therefore it exists the method
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.