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