npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

better-log

1.3.3 • Public • Published

better-log

console.log wrapper for a bit more readable output in Node.js

Tired of seeing hardly readable outputs like this?

regular console.log

Replace them with something more elegant!

better log

Usage

Patching built-in console (API is 100% compatible)

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 :(');

Restoring native console.log:

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!

install

npm i better-log

Downloadsweekly downloads

1,924

version

1.3.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability