1 | var colors = require('../lib/index');
|
2 |
|
3 | console.log('First some yellow text'.yellow);
|
4 |
|
5 | console.log('Underline that text'.yellow.underline);
|
6 |
|
7 | console.log('Make it bold and red'.red.bold);
|
8 |
|
9 | console.log(('Double Raindows All Day Long').rainbow);
|
10 |
|
11 | console.log('Drop the bass'.trap);
|
12 |
|
13 | console.log('DROP THE RAINBOW BASS'.trap.rainbow);
|
14 |
|
15 |
|
16 | console.log('Chains are also cool.'.bold.italic.underline.red);
|
17 |
|
18 |
|
19 | console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse
|
20 | + ' styles! '.yellow.bold);
|
21 | console.log('Zebras are so fun!'.zebra);
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | console.log('This is ' + 'not'.strikethrough + ' fun.');
|
27 |
|
28 | console.log('Background color attack!'.black.bgWhite);
|
29 | console.log('Use random styles on everything!'.random);
|
30 | console.log('America, Heck Yeah!'.america);
|
31 |
|
32 |
|
33 | console.log('Setting themes is useful');
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | console.log('Generic logging theme as JSON'.green.bold.underline);
|
39 |
|
40 | colors.setTheme({
|
41 | silly: 'rainbow',
|
42 | input: 'grey',
|
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 |
|
54 | console.log('this is an error'.error);
|
55 |
|
56 |
|
57 | console.log('this is a warning'.warn);
|
58 |
|
59 |
|
60 | console.log('this is an input'.input);
|
61 |
|
62 | console.log('Generic logging theme as file'.green.bold.underline);
|
63 |
|
64 |
|
65 | try {
|
66 | colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));
|
67 | } catch (err) {
|
68 | console.log(err);
|
69 | }
|
70 |
|
71 |
|
72 | console.log('this is an error'.error);
|
73 |
|
74 |
|
75 | console.log('this is a warning'.warn);
|
76 |
|
77 |
|
78 | console.log('this is an input'.input);
|
79 |
|
80 |
|
81 |
|