之前用了几个都觉得麻烦,索性自己写了一个。
Terminal Text Styled
Terminal display styled text tool. The styled format:
#[foreground [background]] [style]...{ text }
.
Installation
$ npm install terminal-styled
Usage
var show = require('terminal-styled');
// Normal color
show('I am a #red{ %s }.', 'Red');
// RGB color
show('I am a #239,67,165{ Color }.');
// Grayscale
show('I am a #13{ Grayscale }.');
// Blod and red
show('I am #red blod{ Blod and red }.');
GitHub
https://github.com/kankungyip/terminal-styled/
Copyright © 2014 Kan Kung-Yip