Paintbrush
Paintbrush is an ascii coloring tool for nodejs.
It depends only on util.inspect
.
Synopsis
var paint = ; console; console; paintredOnBlack = paint;painterror = paint;paintpath = paintcyan; // actually this is main reason to publish another one moduleconsole; // use to discard colors and repaint output from another programvar httpProcess = child_process; httpProcessstderr; httpProcessstdout;
API
var paint = ;
paint function allows you to write colored messages. First parameter is a color attribute
specification. You can use bold
, italic
, underline
and inverse
modifiers;
white
, grey
, black
, blue
, cyan
, green
, magenta
, red
and yellow
colors;
also every color you can use as background, just add _bg
.
Any following arguments joined with space character between them.
console;
paint.stripColor can be used to discard any color information from string. Also you can use paint.discardColor as an alias.
paint.fillUnpainted will fill any color-absent chunks to color you want. Take a look into example in Synopsis to get idea how it works.