• Tutorials Logic, IN
  • +91 8092939553
  • info@tutorialslogic.com

NodeJS Console

NodeJS Console

A NodeJS console module provides a simple debugging console similar to JavaScript console mechanism provided by web browsers. There are following console methods, which are used to write any NodeJS stream:-

Console MethodsDescription
log()It is used to print standard output (stdout) with newline.
error()It is used to print standard error (stderr) with newline.
warn()It is an alias for error().
info()It is an alias for log().
dir()It uses util.inspect() on obj and prints the resulting string to standard output (stdout).
time()It starts a timer which can be used to compute the duration of an operation.
timeEnd()It stops a timer, started by calling time() and prints the result to standard output (stdout).
trace()It is used to prints a stack trace to standard error (stderr) of the current position.
assert()It tests whether an expression is true. False will throw an AssertionError with a message.
										    
											console.log('Hello Tutorials Logic !');
											console.error('Error');
											console.warn('Warning');
											console.info('Information');