Animates a progress bar for async work. Calls your fn with an update callback. Handles drawing, cleanup, and percent for you.
Function which receives update(progress, label?)
ProgressBar display options
await withProgressBar(async update => { for (let i = 0; i <= 100; i++) { await sleep(25); update(i / 100, `Step ${i}`); } }, { color: 'green' }); Copy
await withProgressBar(async update => { for (let i = 0; i <= 100; i++) { await sleep(25); update(i / 100, `Step ${i}`); } }, { color: 'green' });
Animates a progress bar for async work. Calls your fn with an update callback. Handles drawing, cleanup, and percent for you.