console-stylizer
v1.0.6
Published
Library for console messages stylization
Downloads
28
Readme
console-stylizer
Library for console messages stylization.
Setup
- Install npm package in your project with:
npm install console-stylizer
- Import styliser function and enums with available console types and colors
import {stylize, ConsoleType, ColorsPalette} from 'console-stylizer';
- Run initializer with console type you want to stylise
// Set yellow font color and magenta bacroundg color to console.warn
stylize(ConsoleType.Log, {fontColor: ColorsPalette.yellow, bgColor: ColorsPalette.magenta});
// Set green font color to console.warn
stylize(ConsoleType.Error, {fontColor: ColorsPalette.green});
- Check that styles applied
console.log('test string');
console.warn({test: 'object'});