What's color-format
It can format output strings and make the console looks colorful.
Usage
Format strings
format has two arguments:
-
str
--string to print to stdout. -
opt
--options like{fgc: 'red',bgc: 'yellow',eft: 'underline'}
####Options
-
fgc
--foreground color(defalut'white'
) -
bgc
--background color(defalut'black'
)
you could use one of 'black'
,'red'
,'green'
,'yellow'
,'blue'
,'magenta'
,'cyan'
or 'white'
.
eft
--effect (defalut'reset'
).You could pass a string as'underline'
or an array as['highlight', 'underline']
.
you could use some of 'reset'
,'highlight'
,'dark'
,'underline'
,'flicker'
,'inverse'
or 'none'
.
Example:
var format = format;console;
Warn function
Example:
var warn = warn;;
Error function
Example:
var error = error;;
Notice function
Example:
var notice = notice;;
Info function
Example:
var info = info;;
Command line support
format
usage: format string [options]
Options
-f, --foreground Set foreground color.
-b, --background Set background color.
-v, --version Print the version number and exit.
-h, --help Print help (this message) and exit.
--er effect reset
--eh effect highlight
--ed effect dark
--eu effect underline
--ef effect flicker
--ei effect inverse
--en effect none
Colors
black [ ][ ]
red [ ][ ]
green [ ][ ]
yellow [ ][ ]
blue [ ][ ]
magenta [ ][ ]
cyan [ ][ ]
white [ ][ ]