GithubHelp home page GithubHelp logo

better-console's Introduction

Better Console

Screenshot

Installation

Use NPM

$ 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.

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);

Methods

console.log, console.warn, console.error, console.info, console.debug, console.dir, console.trace

These methods work exactly same as native console methods but with colors for warn, info or error

console.clear

Clears the screen

console.table

Draws a table of data if a 2d array or object passed to it

console.time

Creates a new timer under the given name. Call console.timeEnd(name)` with the same name to stop the timer and print the time elapsed.

console.timeEnd

Stops a timer created by a call to console.time(name) and write the time

console.count

Writes number of times each argument is called with blue color

TODOs

  • Use Unicode icons to mimic browser console icons in OSX
  • Make console.trace more detailed with V8 flags

better-console's People

Contributors

mohsen1 avatar vasiliicuhar avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.