Under development, don't use
Marak/colors – modifies String
prototype... facepalm.
SindreSorhus/chalk – overengineered, fluent API sucks at composition
let {blue, red} = require("cli-colors")
console.log("one " + red("two " + blue("three ") + "four " + blue("five ") + "six ") + "seven")
Use function composition to combine styles:
let {pipe} = require("ramda")
let {bgBlue, white} = require("cli-colors")
let banner = pipe(bgBlue, white)
console.log(banner("============="))
console.log(banner(" H E L L O "))
console.log(banner("============="))
let colors = require("cli-colors")
// or import * as colors from "cli-colors"
colors.bold
colors.hidden
colors.inverse
colors.italic
colors.strikethrough
colors.underline
colors.black
colors.blue
colors.cyan
colors.gray
colors.green
colors.grey (alias)
colors.magenta
colors.red
colors.yellow
colors.white
colors.bgBlack
colors.bgBlue
colors.bgCyan
colors.bgGreen
colors.bgMagenta
colors.bgRed
colors.bgYellow
colors.bgWhite
colors.reset
colors.styles