Terminal Pallette allows you to call methods on your strings to change the style (limited), color or background you log to the terminal.
I wanted something similar to Chalk with the ability to call the methods on a string. Terminal Palette uses the package ansi-styles
Note: This will polutte the string object adding to the prototype of String
reset
bold
dim
italic
(Not widely supported)underline
inverse
hidden
strikethrough
(Not widely supported)
black
red
green
yellow
blue
magenta
cyan
white
gray
("bright black")redBright
greenBright
yellowBright
blueBright
magentaBright
cyanBright
whiteBright
bgBlack
bgRed
bgGreen
bgYellow
bgBlue
bgMagenta
bgCyan
bgWhite
bgBlackBright
bgRedBright
bgGreenBright
bgYellowBright
bgBlueBright
bgMagentaBright
bgCyanBright
bgWhiteBright
e.g.
// require in library, this will add it feature to strings
require('terminal-palette')
console.log("This text will be blue".blue())
// Template string example, chain example
console.log(`hello ${'world'.red().bgYellow()}`.blue())