console.log style color code example

Example 1: js console log with color

console.log('%c Oh my heavens! ', 'background: #222; color: #bada55');

Example 2: console.log with color font

var colors = require('colors');

console.log('i am black'.black);
console.log('i am red'.red);
console.log('i am green'.green);
console.log('i am black'.yellow);
console.log('i am blue'.blue);
console.log('i am magenta'.magenta);
console.log('i am cyan'.cyan);
console.log('i am white'.white);
console.log('i am gray'.gray);
console.log('i am grey'.grey);

Example 3: console.log with color font

var colors = require('colors');

console.log('This is bold'.bold);
console.log('This is dim'.dim);
console.log('This is italic'.italic);
console.log('This is underline'.underline);
console.log('This is inverse'.inverse);
console.log('This is hidden'.hidden);

Tags:

Css Example