0.0.8 • Published 8 years ago
terminal-palette v0.0.8
🎨 Terminal Palette
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
Styles
Modifiers
resetbolddimitalic(Not widely supported)underlineinversehiddenstrikethrough(Not widely supported)
Colors
blackredgreenyellowbluemagentacyanwhitegray("bright black")redBrightgreenBrightyellowBrightblueBrightmagentaBrightcyanBrightwhiteBright
Background colors
bgBlackbgRedbgGreenbgYellowbgBluebgMagentabgCyanbgWhitebgBlackBrightbgRedBrightbgGreenBrightbgYellowBrightbgBlueBrightbgMagentaBrightbgCyanBrightbgWhiteBright
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())