Enhance Console Logs With Pure JavaScript – Badgee

Category: Javascript | August 9, 2017
Author: dharFr
Views Total: 160
Official Page: Go to website
Last Update: August 9, 2017
License: MIT

Preview:

Enhance Console Logs With Pure JavaScript – Badgee

Description:

Badgee is a JavaScript library to enhance & improve the default browser console logs with custom badges and styles.

How to use it:

Install the Badgee via NPM.

npm install --save badgee

Import the Badgee into your project.

import badgee from 'badgee';

Or directly include the JavaScript file ‘badgee.umd.js’ on the webpage.

<script src="build/badgee.umd.js"></script>

Show a basic message in the console log.

badgee.log('Text here...');

Config the console log.

badgee.config({

  // If set to false, logs will no longer be displayed to the console.
  enabled: true,

  // If set to false, label prefixes will be displayed with default output style. 
  styled: false
  
});

Add custom badges to the console logs.

var myBadge = badgee.define('Badge Name', 'green');
myBadge.log('hello badge defined!');

Apply your own CSS styles to the console logs.

badgee.style({
  // CSS styles here
})