Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

better-log

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-log

console.log wrapper for a bit more readable output

latest
Source
npmnpm
Version
1.3.3
Version published
Weekly downloads
834
-12.49%
Maintainers
1
Weekly downloads
 
Created
Source

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!

Keywords

console

FAQs

Package last updated on 26 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts