-
Notifications
You must be signed in to change notification settings - Fork 0
/
spinner1.js
44 lines (34 loc) · 873 Bytes
/
spinner1.js
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
setTimeout(() => {
process.stdout.write('\r| ');
}, 100);
setTimeout(() => {
process.stdout.write('\r/ ');
}, 300);
setTimeout(() => {
process.stdout.write('\r- ');
}, 500);
setTimeout(() => {
// Need to escape the backslash since it's a special character.
process.stdout.write('\r\\ ');
}, 700);
// ... fill in the rest yourself ...
setTimeout(() => {
process.stdout.write('\r| ');
}, 900);
setTimeout(() => {
process.stdout.write('\r/ ');
}, 1100);
setTimeout(() => {
process.stdout.write('\r- ');
}, 1300);
setTimeout(() => {
// Need to escape the backslash since it's a special character.
process.stdout.write('\r\\ ');
}, 1500);
setTimeout(() => {
process.stdout.write('\r| ');
}, 1700);
setTimeout(() => {
// Need to escape the backslash since it's a special character.
process.stdout.write('\r\n');
}, 1900);