$ npm i node-colorize -g
Import module by using
const Colorize = require('node-colorize');
Create new instanse of Colorize class:
const colored = new Colorize();
Output colored text in console by using color methods:
colored.green('Hello world');
Use random style from colored.styles:
colored.random('Hello world');
Every letter is colored in random color from colored.styles:
colored.allColors('Hello world');
Also you can use custom escape sequense or style saved in colored.styles:
colored.styled(colored.styles.underline, 'Hello world');