colored-console-log
v1.0.3
Published
A JavaScript module, which allows app to log colored console logs in browser console.
Downloads
34
Maintainers
Readme
colored-console-log
A JavaScript API module, which allows app to log colored console logs in browser console.
Installation
Installing this module is pretty easy using npm:
npm install colored-console-log
Then just add the module into your HTML:
In your HTML
<script src="node_modules/colored-console-log/js/colored-console-log.js"></script>
Usage
You can print colored logs in browser console using any of these three functions:
Using colored.logs()
colored.logs("This text will have red font-color and black background.", "red", "black");
Using color.logs()
color.logs("This text will have yellow font-color and blue background.", "yellow", "blue");
Using cc.logs()
cc.logs("This text will have #00FF00 font-color and #000000 background.", "#00FF00", "#000000");
Customizable / Optional parameters:
colored.logs(Text, Font-color, Background-color)
Parameters
- Text: [String] Message you want to display in console log.
- Font-color: [String][Optional] Font color of text in log, can be HEX value. Default is Black.
- Background-color: [String][Optional] Background color text in log, can be HEX value. Default is White
You can use these function parameters in folowing ways:
colored.logs("This text will have red font-color and white(default) background.", "red");
color.logs("This text will have black(default) font-color and blue background.", "", "blue");
cc.logs("This text will have black(default) font-color and white(default) background.");
License
MIT