-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a script to visualise the loading progress with emojis 🧪
- Loading branch information
Showing
3 changed files
with
49 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import readline from 'readline' | ||
|
||
import { getProgressConfig } from '../src/config.js' | ||
|
||
const visualise = () => { | ||
const [startChar, endChar, progressLength] = getProgressConfig(new Date('2025-01-01')) | ||
|
||
const display = count => { | ||
const complete = startChar.repeat(count) | ||
const incomplete = endChar.repeat(progressLength - count) | ||
const percent = (count / progressLength * 100).toFixed() | ||
|
||
readline.clearLine(process.stdout, 0) | ||
readline.cursorTo(process.stdout, 0) | ||
process.stdout.write(`${complete}${incomplete} | ${percent}% Testing...`) | ||
|
||
if (count < progressLength) { | ||
setTimeout(() => { | ||
display(count += 1) | ||
}, 100) | ||
} | ||
} | ||
|
||
display(0) | ||
} | ||
|
||
visualise() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters