better-log
UPDATE: This is no longer necessary in Node.js 10.x.x as it colors output of console.log
by default.
console.log wrapper for a bit more readable output in Node.js
Tired of seeing hardly readable outputs like this?
Replace them with something more elegant!
Usage
console
(API is 100% compatible)
Patching built-in require('better-log/install'); // ES6: import 'better-log/install';
console.log({ x: 1, y: 'prop' });
console.error('Something bad happened :(');
or
require('better-log').install({ depth: 2 }); // optional config
console.log({ x: 1, y: 'prop' });
console.error('Something bad happened :(');
console.log
and console.error
:
Restoring native require('better-log').uninstall();
Manual usage as a regular function
var log = require('better-log')/* .setConfig({ depth: 2 }) */;
log({ x: 1, y: 'prop' });
log.error('Something bad happened :(');
That's it!