how to use diffrent colours while using console.log in nightwatch js

  • 1 Replies
  • 1537 Views
npm install colors


var colors = require('colors');

console.log('hello'.green); // outputs green text
console.log('i like cake and pies'.underline.red) // outputs red underlined text
console.log('inverse the color'.inverse); // inverses the color
console.log('OMG Rainbows!'.rainbow); // rainbow
console.log('Run the trap'.trap); // Drops the bass


does this workes in nightwatch js

*

Oren

  • **
  • 59
Try using this library: https://www.npmjs.com/package/cli-color
It works for me.

$ npm install cli-color

var clc = require('cli-color');

Code
var error = clc.red.bold;
var warn = clc.yellow;
var notice = clc.blue;

console.log(clc.red('Text in red'));
console.log(error('Error!'));
console.log(warn('Warning'));
console.log(notice('Notice'));

 

Sitemap 1 2 3 4 5 6 7 8