Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cosnt chalk = require('chalk');
- var colorIdx = 0;
- var rainbowLog = function (str) {
- var ary = [
- str => chalk.bold.red(str),
- str => chalk.bold.yellow(str),
- str => chalk.bold.yellowBright(str),
- str => chalk.bold.green(str),
- str => chalk.bold.cyan(str),
- str => chalk.bold.blue(str),
- str => chalk.bold.magenta(str),
- ];
- if (!ary[colorIdx]) {
- colorIdx = 0;
- }
- return ary[colorIdx++](str);
- };
Add Comment
Please, Sign In to add comment