One of the most advanced ansi string rainbow stylizer tool
Rainbowify string with https://github.com/sindresorhus/ansi-styles
npm install ansi-rainbow
var rainbow = require'ansi-rainbow'console.lograinbowr"I am in the pony world"//orconsole.lograinbowr"I" "am" "in" "the" "pony" "world"//what about background rainbows?console.lograinbowbg"I am a background in the pony world"
Rainbow is skipping black and white colors (did you ever seen these on a rainbow?). But, we could imagine that in a world where Pony's are flying, black could be part of a rainbow so:
rainbowadd'black white' //adds black and white
Let's write all features together to print a rainbow flag \o/:
rainbowadd'black' 'white'reset //we do not want black and white anymore - note it does not reset options only colorsskiprainbow_backgrounds //skips backgroundsadd'bgBlue bgMagenta bgCyan' //this will keep order when rainbowifiedoptionscolor_space: true gap: 3 //this will force color spaces and change color every 3 charactersconsole.lograinbowbg' 'console.lograinbowbg'123456789'console.lograinbowbg' '
What about everything that is not a string?