[6a3a178] | 1 | var colors = require('../safe');
|
---|
| 2 |
|
---|
| 3 | console.log(colors.yellow('First some yellow text'));
|
---|
| 4 |
|
---|
| 5 | console.log(colors.yellow.underline('Underline that text'));
|
---|
| 6 |
|
---|
| 7 | console.log(colors.red.bold('Make it bold and red'));
|
---|
| 8 |
|
---|
| 9 | console.log(colors.rainbow('Double Raindows All Day Long'));
|
---|
| 10 |
|
---|
| 11 | console.log(colors.trap('Drop the bass'));
|
---|
| 12 |
|
---|
| 13 | console.log(colors.rainbow(colors.trap('DROP THE RAINBOW BASS')));
|
---|
| 14 |
|
---|
| 15 | // styles not widely supported
|
---|
| 16 | console.log(colors.bold.italic.underline.red('Chains are also cool.'));
|
---|
| 17 |
|
---|
| 18 | // styles not widely supported
|
---|
| 19 | console.log(colors.green('So ') + colors.underline('are') + ' '
|
---|
| 20 | + colors.inverse('inverse') + colors.yellow.bold(' styles! '));
|
---|
| 21 |
|
---|
| 22 | console.log(colors.zebra('Zebras are so fun!'));
|
---|
| 23 |
|
---|
| 24 | console.log('This is ' + colors.strikethrough('not') + ' fun.');
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 | console.log(colors.black.bgWhite('Background color attack!'));
|
---|
| 28 | console.log(colors.random('Use random styles on everything!'));
|
---|
| 29 | console.log(colors.america('America, Heck Yeah!'));
|
---|
| 30 |
|
---|
| 31 | console.log(colors.brightCyan('Blindingly ') + colors.brightRed('bright? ') + colors.brightYellow('Why ') + colors.brightGreen('not?!'));
|
---|
| 32 |
|
---|
| 33 | console.log('Setting themes is useful');
|
---|
| 34 |
|
---|
| 35 | //
|
---|
| 36 | // Custom themes
|
---|
| 37 | //
|
---|
| 38 | // console.log('Generic logging theme as JSON'.green.bold.underline);
|
---|
| 39 | // Load theme with JSON literal
|
---|
| 40 | colors.setTheme({
|
---|
| 41 | silly: 'rainbow',
|
---|
| 42 | input: 'blue',
|
---|
| 43 | verbose: 'cyan',
|
---|
| 44 | prompt: 'grey',
|
---|
| 45 | info: 'green',
|
---|
| 46 | data: 'grey',
|
---|
| 47 | help: 'cyan',
|
---|
| 48 | warn: 'yellow',
|
---|
| 49 | debug: 'blue',
|
---|
| 50 | error: 'red',
|
---|
| 51 | });
|
---|
| 52 |
|
---|
| 53 | // outputs red text
|
---|
| 54 | console.log(colors.error('this is an error'));
|
---|
| 55 |
|
---|
| 56 | // outputs yellow text
|
---|
| 57 | console.log(colors.warn('this is a warning'));
|
---|
| 58 |
|
---|
| 59 | // outputs blue text
|
---|
| 60 | console.log(colors.input('this is an input'));
|
---|
| 61 |
|
---|
| 62 |
|
---|
| 63 | // console.log('Generic logging theme as file'.green.bold.underline);
|
---|
| 64 |
|
---|
| 65 | // Load a theme from file
|
---|
| 66 | colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));
|
---|
| 67 |
|
---|
| 68 | // outputs red text
|
---|
| 69 | console.log(colors.error('this is an error'));
|
---|
| 70 |
|
---|
| 71 | // outputs yellow text
|
---|
| 72 | console.log(colors.warn('this is a warning'));
|
---|
| 73 |
|
---|
| 74 | // outputs grey text
|
---|
| 75 | console.log(colors.input('this is an input'));
|
---|
| 76 |
|
---|
| 77 | // console.log(colors.zalgo("Don't summon him"))
|
---|
| 78 |
|
---|
| 79 |
|
---|