Package Exports
- fuzzy-ansi-color
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fuzzy-ansi-color) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
fuzzy-ansi-color
compute ansi color modes fuzzily with strings
example
var colorize = require('fuzzy-ansi-color');
process.stdout.write(Buffer.concat([
colorize('bright cyan'),
Buffer('hello '),
colorize('bg dim #c540a0 fg bright yellow'),
Buffer('world\n'),
colorize('reset')
]));syntax
The syntax is a string that gets split on whitespace into an array of commands.
Use a named color to set a color by its name.
Use /^#[0-9a-f]{6}/ to set the color with a hex code.
Use rgb(\d+,\d+,\d+) to set the color with an rgb code with values from 0
through 255, inclusive.
If you pass in an array for one of the parts, it will be treated as an rgb code.
Set the mode with:
brightdimunderscoreblinkreversehidden
Control whether to set the foreground or background mode with:
fgbg
Use the string reset to reset the color and mode.
methods
var colorize = require('fuzzy-ansi-color')var buf = colorize(s)
Turn a string or array s into a colorized buffer buf.
install
With npm do:
npm install fuzzy-ansi-colorlicense
MIT