-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtest-split-color-codes.js
More file actions
45 lines (37 loc) · 900 Bytes
/
test-split-color-codes.js
File metadata and controls
45 lines (37 loc) · 900 Bytes
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
"use strict";
const cyanVariations = [
["\x1B[36m"],
["\x1B[36", "m"],
["\x1B[3", "6m"],
["\x1B[", "36m"],
["\x1B", "[36m"],
["\x1B[3", "6", "m"],
["\x1B[", "3", "6m"],
["\x1B", "[", "36m"],
["\x1B[", "36", "m"],
["\x1B", "[3", "6m"],
["\x1B", "[36", "m"],
["\x1B[", "3", "6", "m"],
["\x1B", "[", "3", "6m"],
["\x1B", "[", "36", "m"],
["\x1B", "[3", "6", "m"],
["\x1B", "[", "3", "6", "m"],
];
/**
* @param {number} ms
* @returns {Promise<void>}
*/
const waitMs = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
async function run() {
for (const [index, variation] of cyanVariations.entries()) {
for (const segment of variation) {
process.stdout.write(segment);
await waitMs(1);
}
process.stdout.write(
`Line ${index + 1} (${variation.length} variations)\x1B[0m\n`,
);
await waitMs(100);
}
}
void run();