Skip to content

Adding colors to console.logs inside browser inspector

License

Notifications You must be signed in to change notification settings

ba5eem/react-console-colors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-console-colors

Adding colors to console.logs inside browser inspector.

I made this to make it easier/quicker to find console logs during development.

This adds methods using prototype, so requiring it once on entry file will make it globally accessible.

Installation

npm install react-console-colors -D

##Limitations (colors):

Types supported: String, Number, {}, []

Support for only one argument, working on handling more

Colors:

.cyan()
.green()
.red()
.black()
.yellow()
.magenta()

Usage

require('react-console-colors');

let string = 'Hello World';
let array = ['Hello World'];
let number = 12345;
let object = {
  name: 'hello',
  type: 'world'
}

string.cyan()
array.red()
number.magenta()
object.green()

##Limitations(any):

Types supported: String, Number

Support for only one argument & one style option, see usage example:

Usage for console.any

var style = [
  'background-color: cornflowerblue',
  'font-size: 30px',
  'color: white',
  'border-radius: 50px'
];

console.any('hello world',style);

FYI: For NodeJS color output you can find a much better package called 'colors'

About

Adding colors to console.logs inside browser inspector

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published