$ npm install better-console
A better console for Node.js
better-console is a drop-in replacement for node's default console which
gives you colors and more methods in console.
How to use it
You can override
console object itself or assign better console to another variable. It's completely safe to override the native console object because better console calls native console methods for methods that are already available in it.
var console = require('better-console'); console.log("This is a log information"); console.warn("Warning!"); console.info("Information"); console.table([ [1,2], [3,4] ]); console.time("Timer"); console.timeEnd("Timer"); console.dir(myObject);
These methods work exactly same as native console methods but with colors for
Clears the screen
Draws a table of data if a 2d array or object passed to it
Creates a new timer under the given name. Call
with the same name to stop the timer and print the time elapsed.
Stops a timer created by a call to console.time(name) and write the time
Writes number of times each argument is called with blue color
- Use Unicode icons to mimic browser console icons in OSX
console.tracemore detailed with V8 flags