1.1.2 • Published 6 years ago
colors4strict v1.1.2
colors4strict
Node module that allows you to color your console logging, even in strict mode
Usage (Example code below:)
/* Require the colors4strict nodemodule */
const colors = require('colors4strict');
/* Your text here */
var text = 'Text';
text = colors.white(text); // returns the text in white
text = colors.cyan(text); // returns the text in cyan
text = colors.magenta(text); // returns the text in magenta
text = colors.blue(text); // returns the text in blue
text = colors.yellow(text); // returns the text in yellow
text = colors.green(text); // returns the text in green
text = colors.red(text); // returns the text in red
text = colors.black(text); // returns the text in black
/* This also works */
text = colors.green('Green ' + colors.yellow('Yellow ') + 'Green');
// ...
console.log(text);
Removing colors
/* Example */
var coloredText = colors.blue('Text');
/* Logs the text in the blue color */
console.log(text);
coloredText = colors.remove(coloredText);
/* Logs the text in the default cli color */
console.log(text);
Disabling colors
If you wanna disable the colors pass the following argument --no-colors
to your application
Example:
node myscript.js --no-colors