Package Exports
- unicorn
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 (unicorn) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
#unicorn Add some color to your command line.
Available styles
Colors | Specials |
Black | Normal |
Red | Bold |
Green | Underline |
Yellow | Blinking |
Blue | Reverse |
Magenta | |
Cyan | |
White |
Installation
Unicorn is available through NPM, so all you have to do is:
npm install unicorn
Usage
Unicorn extends the String
class to add his features so you don't need to save a reference to it. Just make sure you've installed the module.:
require('unicorn').install();
Colors
console.log('red'.red());
console.log('background red'.red(true));
console.log('green'.green());
console.log('background green'.green(true));
console.log('background blue and yellow text'.green(true).yellow());
console.log('background white and black text'.white(true).black());
Specials
console.log('thin'.normal());
console.log('bold'.bold());
console.log('underline'.underline());
console.log('blinking'.blinking());
console.log('reverse'.reverse());
Mixed
console.log('foo'.red().yellow(true).bold());
console.log('bar'.green(true).underline().black());
console.log('lorem'.underline().magenta(true).white());
console.log('ipsum'.bold().magenta().blue(true));
Unicorn
The best feature.
var i = 5;
while(i > 0) {
console.log('UNICORN'.unicorn());
--i;
}
License
Unicorn is available under MIT license.