colors 1.2.1 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,76 +1,77 @@
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
- console.log(colors.bold.italic.underline.red('Chains are also cool.')); // styles not widely supported
16
-
17
-
18
- console.log(colors.green('So ') + colors.underline('are') + ' ' + colors.inverse('inverse') + colors.yellow.bold(' styles! ')); // styles not widely supported
19
-
20
- console.log(colors.zebra("Zebras are so fun!"));
21
-
22
- console.log("This is " + colors.strikethrough("not") + " fun.");
23
-
24
-
25
- console.log(colors.black.bgWhite('Background color attack!'));
26
- console.log(colors.random('Use random styles on everything!'))
27
- console.log(colors.america('America, Heck Yeah!'));
28
-
29
- console.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
36
- colors.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
50
- console.log(colors.error("this is an error"));
51
-
52
- // outputs yellow text
53
- console.log(colors.warn("this is a warning"));
54
-
55
- // outputs grey text
56
- console.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
62
- colors.setTheme(__dirname + '/../themes/generic-logging.js');
63
-
64
- // outputs red text
65
- console.log(colors.error("this is an error"));
66
-
67
- // outputs yellow text
68
- console.log(colors.warn("this is a warning"));
69
-
70
- // outputs grey text
71
- console.log(colors.input("this is an input"));
72
-
73
- // console.log(colors.zalgo("Don't summon him"))
74
-
75
-
76
-
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('Setting themes is useful');
32
+
33
+ //
34
+ // Custom themes
35
+ //
36
+ // console.log('Generic logging theme as JSON'.green.bold.underline);
37
+ // Load theme with JSON literal
38
+ colors.setTheme({
39
+ silly: 'rainbow',
40
+ input: 'grey',
41
+ verbose: 'cyan',
42
+ prompt: 'grey',
43
+ info: 'green',
44
+ data: 'grey',
45
+ help: 'cyan',
46
+ warn: 'yellow',
47
+ debug: 'blue',
48
+ error: 'red',
49
+ });
50
+
51
+ // outputs red text
52
+ console.log(colors.error('this is an error'));
53
+
54
+ // outputs yellow text
55
+ console.log(colors.warn('this is a warning'));
56
+
57
+ // outputs grey text
58
+ console.log(colors.input('this is an input'));
59
+
60
+
61
+ // console.log('Generic logging theme as file'.green.bold.underline);
62
+
63
+ // Load a theme from file
64
+ colors.setTheme(__dirname + '/../themes/generic-logging.js');
65
+
66
+ // outputs red text
67
+ console.log(colors.error('this is an error'));
68
+
69
+ // outputs yellow text
70
+ console.log(colors.warn('this is a warning'));
71
+
72
+ // outputs grey text
73
+ console.log(colors.input('this is an input'));
74
+
75
+ // console.log(colors.zalgo("Don't summon him"))
76
+
77
+
package/index.d.ts CHANGED
@@ -1,134 +1,136 @@
1
- // Type definitions for Colors.js 1.2
2
- // Project: https://github.com/Marak/colors.js
3
- // Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Staffan Eketorp <https://github.com/staeke>
4
- // Definitions: https://github.com/Marak/colors.js
5
-
6
- export interface Color {
7
- (text: string): string;
8
-
9
- strip: Color;
10
- stripColors: Color;
11
-
12
- black: Color;
13
- red: Color;
14
- green: Color;
15
- yellow: Color;
16
- blue: Color;
17
- magenta: Color;
18
- cyan: Color;
19
- white: Color;
20
- gray: Color;
21
- grey: Color;
22
-
23
- bgBlack: Color;
24
- bgRed: Color;
25
- bgGreen: Color;
26
- bgYellow: Color;
27
- bgBlue: Color;
28
- bgMagenta: Color;
29
- bgCyan: Color;
30
- bgWhite: Color;
31
-
32
- reset: Color;
33
- bold: Color;
34
- dim: Color;
35
- italic: Color;
36
- underline: Color;
37
- inverse: Color;
38
- hidden: Color;
39
- strikethrough: Color;
40
-
41
- rainbow: Color;
42
- zebra: Color;
43
- america: Color;
44
- trap: Color;
45
- random: Color;
46
- zalgo: Color;
47
- }
48
-
49
- export function setTheme(theme: any): void;
50
-
51
- export let enabled: boolean;
52
-
53
- export const strip: Color;
54
- export const stripColors: Color;
55
-
56
- export const black: Color;
57
- export const red: Color;
58
- export const green: Color;
59
- export const yellow: Color;
60
- export const blue: Color;
61
- export const magenta: Color;
62
- export const cyan: Color;
63
- export const white: Color;
64
- export const gray: Color;
65
- export const grey: Color;
66
-
67
- export const bgBlack: Color;
68
- export const bgRed: Color;
69
- export const bgGreen: Color;
70
- export const bgYellow: Color;
71
- export const bgBlue: Color;
72
- export const bgMagenta: Color;
73
- export const bgCyan: Color;
74
- export const bgWhite: Color;
75
-
76
- export const reset: Color;
77
- export const bold: Color;
78
- export const dim: Color;
79
- export const italic: Color;
80
- export const underline: Color;
81
- export const inverse: Color;
82
- export const hidden: Color;
83
- export const strikethrough: Color;
84
-
85
- export const rainbow: Color;
86
- export const zebra: Color;
87
- export const america: Color;
88
- export const trap: Color;
89
- export const random: Color;
90
- export const zalgo: Color;
91
-
92
- declare global {
93
- interface String {
94
- strip: string;
95
- stripColors: string;
96
-
97
- black: string;
98
- red: string;
99
- green: string;
100
- yellow: string;
101
- blue: string;
102
- magenta: string;
103
- cyan: string;
104
- white: string;
105
- gray: string;
106
- grey: string;
107
-
108
- bgBlack: string;
109
- bgRed: string;
110
- bgGreen: string;
111
- bgYellow: string;
112
- bgBlue: string;
113
- bgMagenta: string;
114
- bgCyan: string;
115
- bgWhite: string;
116
-
117
- reset: string;
118
- // @ts-ignore
119
- bold: string;
120
- dim: string;
121
- italic: string;
122
- underline: string;
123
- inverse: string;
124
- hidden: string;
125
- strikethrough: string;
126
-
127
- rainbow: string;
128
- zebra: string;
129
- america: string;
130
- trap: string;
131
- random: string;
132
- zalgo: string;
133
- }
134
- }
1
+ // Type definitions for Colors.js 1.2
2
+ // Project: https://github.com/Marak/colors.js
3
+ // Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Staffan Eketorp <https://github.com/staeke>
4
+ // Definitions: https://github.com/Marak/colors.js
5
+
6
+ export interface Color {
7
+ (text: string): string;
8
+
9
+ strip: Color;
10
+ stripColors: Color;
11
+
12
+ black: Color;
13
+ red: Color;
14
+ green: Color;
15
+ yellow: Color;
16
+ blue: Color;
17
+ magenta: Color;
18
+ cyan: Color;
19
+ white: Color;
20
+ gray: Color;
21
+ grey: Color;
22
+
23
+ bgBlack: Color;
24
+ bgRed: Color;
25
+ bgGreen: Color;
26
+ bgYellow: Color;
27
+ bgBlue: Color;
28
+ bgMagenta: Color;
29
+ bgCyan: Color;
30
+ bgWhite: Color;
31
+
32
+ reset: Color;
33
+ bold: Color;
34
+ dim: Color;
35
+ italic: Color;
36
+ underline: Color;
37
+ inverse: Color;
38
+ hidden: Color;
39
+ strikethrough: Color;
40
+
41
+ rainbow: Color;
42
+ zebra: Color;
43
+ america: Color;
44
+ trap: Color;
45
+ random: Color;
46
+ zalgo: Color;
47
+ }
48
+
49
+ export function enable(): void;
50
+ export function disable(): void;
51
+ export function setTheme(theme: any): void;
52
+
53
+ export let enabled: boolean;
54
+
55
+ export const strip: Color;
56
+ export const stripColors: Color;
57
+
58
+ export const black: Color;
59
+ export const red: Color;
60
+ export const green: Color;
61
+ export const yellow: Color;
62
+ export const blue: Color;
63
+ export const magenta: Color;
64
+ export const cyan: Color;
65
+ export const white: Color;
66
+ export const gray: Color;
67
+ export const grey: Color;
68
+
69
+ export const bgBlack: Color;
70
+ export const bgRed: Color;
71
+ export const bgGreen: Color;
72
+ export const bgYellow: Color;
73
+ export const bgBlue: Color;
74
+ export const bgMagenta: Color;
75
+ export const bgCyan: Color;
76
+ export const bgWhite: Color;
77
+
78
+ export const reset: Color;
79
+ export const bold: Color;
80
+ export const dim: Color;
81
+ export const italic: Color;
82
+ export const underline: Color;
83
+ export const inverse: Color;
84
+ export const hidden: Color;
85
+ export const strikethrough: Color;
86
+
87
+ export const rainbow: Color;
88
+ export const zebra: Color;
89
+ export const america: Color;
90
+ export const trap: Color;
91
+ export const random: Color;
92
+ export const zalgo: Color;
93
+
94
+ declare global {
95
+ interface String {
96
+ strip: string;
97
+ stripColors: string;
98
+
99
+ black: string;
100
+ red: string;
101
+ green: string;
102
+ yellow: string;
103
+ blue: string;
104
+ magenta: string;
105
+ cyan: string;
106
+ white: string;
107
+ gray: string;
108
+ grey: string;
109
+
110
+ bgBlack: string;
111
+ bgRed: string;
112
+ bgGreen: string;
113
+ bgYellow: string;
114
+ bgBlue: string;
115
+ bgMagenta: string;
116
+ bgCyan: string;
117
+ bgWhite: string;
118
+
119
+ reset: string;
120
+ // @ts-ignore
121
+ bold: string;
122
+ dim: string;
123
+ italic: string;
124
+ underline: string;
125
+ inverse: string;
126
+ hidden: string;
127
+ strikethrough: string;
128
+
129
+ rainbow: string;
130
+ zebra: string;
131
+ america: string;
132
+ trap: string;
133
+ random: string;
134
+ zalgo: string;
135
+ }
136
+ }