-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathcomplex.mjs
157 lines (144 loc) · 3.27 KB
/
complex.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/* @prettier */
import { run, bench, summary } from "mitata"
import * as colorette from "colorette"
import kleur from "kleur"
import * as kleurColors from "kleur/colors"
import chalk from "chalk"
import chalk5 from "chalk5"
import ansi from "ansi-colors"
import cliColor from "cli-color"
import picocolors from "../picocolors.js"
import * as nanocolors from "nanocolors"
import * as yoctocolors from "yoctocolors"
summary(() => {
let index = 1e8
bench(
"chalk v4",
() =>
chalk.red(".") +
chalk.yellow(".") +
chalk.green(".") +
chalk.bgRed(chalk.black(" ERROR ")) +
chalk.red(
" Add plugin " + chalk.yellow("name") + " to use time limit with " + chalk.yellow(++index)
)
)
bench(
"chalk v5",
() =>
chalk5.red(".") +
chalk5.yellow(".") +
chalk5.green(".") +
chalk5.bgRed(chalk5.black(" ERROR ")) +
chalk5.red(
" Add plugin " + chalk5.yellow("name") + " to use time limit with " + chalk5.yellow(++index)
)
)
bench(
"yoctocolors",
() =>
yoctocolors.red(".") +
yoctocolors.yellow(".") +
yoctocolors.green(".") +
yoctocolors.bgRed(yoctocolors.black(" ERROR ")) +
yoctocolors.red(
" Add plugin " +
yoctocolors.yellow("name") +
" to use time limit with " +
yoctocolors.yellow(++index)
)
)
bench(
"cli-color",
() =>
cliColor.red(".") +
cliColor.yellow(".") +
cliColor.green(".") +
cliColor.bgRed(cliColor.black(" ERROR ")) +
cliColor.red(
" Add plugin " +
cliColor.yellow("name") +
" to use time limit with " +
cliColor.yellow(++index)
)
)
bench(
"ansi-colors",
() =>
ansi.red(".") +
ansi.yellow(".") +
ansi.green(".") +
ansi.bgRed(ansi.black(" ERROR ")) +
ansi.red(
" Add plugin " + ansi.yellow("name") + " to use time limit with " + ansi.yellow(++index)
)
)
bench(
"kleur",
() =>
kleur.red(".") +
kleur.yellow(".") +
kleur.green(".") +
kleur.bgRed(kleur.black(" ERROR ")) +
kleur.red(
" Add plugin " + kleur.yellow("name") + " to use time limit with " + kleur.yellow(++index)
)
)
bench(
"kleur/colors",
() =>
kleurColors.red(".") +
kleurColors.yellow(".") +
kleurColors.green(".") +
kleurColors.bgRed(kleurColors.black(" ERROR ")) +
kleurColors.red(
" Add plugin " +
kleurColors.yellow("name") +
" to use time limit with " +
kleurColors.yellow(++index)
)
)
bench(
"colorette",
() =>
colorette.red(".") +
colorette.yellow(".") +
colorette.green(".") +
colorette.bgRed(colorette.black(" ERROR ")) +
colorette.red(
" Add plugin " +
colorette.yellow("name") +
" to use time limit with " +
colorette.yellow(++index)
)
)
bench(
"nanocolors",
() =>
nanocolors.red(".") +
nanocolors.yellow(".") +
nanocolors.green(".") +
nanocolors.bgRed(nanocolors.black(" ERROR ")) +
nanocolors.red(
" Add plugin " +
nanocolors.yellow("name") +
" to use time limit with " +
nanocolors.yellow(++index)
)
)
bench(
"picocolors",
() =>
picocolors.red(".") +
picocolors.yellow(".") +
picocolors.green(".") +
picocolors.bgRed(picocolors.black(" ERROR ")) +
picocolors.red(
" Add plugin " +
picocolors.yellow("name") +
" to use time limit with " +
picocolors.yellow(`${++index}`)
)
)
})
await run()