Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cli/unstable_progress_bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ export interface ProgressBarOptions {
*/
keepOpen?: boolean;
/**
* How often the progress bar updates. The progress bar will be updated every
* `refreshMilliseconds` milliseconds.
* @default {1000}
* The time between each frame of the progress bar in milliseconds.
*
* @default {75}
*/
refreshMilliseconds?: number;
interval?: number;
}

const LINE_CLEAR = "\r\u001b[K";
Expand Down Expand Up @@ -223,7 +223,7 @@ export class ProgressBar {
clear = false,
formatter = defaultFormatter,
keepOpen = true,
refreshMilliseconds = 1000,
interval = 1000,
} = options;
this.value = value;
this.max = max;
Expand All @@ -243,7 +243,7 @@ export class ProgressBar {
this.#previousTime = 0;
this.#previousValue = this.value;

this.#id = setInterval(() => this.#print(), refreshMilliseconds);
this.#id = setInterval(() => this.#print(), interval);
this.#print();
}
#createFormatterObject() {
Expand Down
2 changes: 1 addition & 1 deletion cli/unstable_progress_bar_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Deno.test("ProgressBar() prints twice every second", async () => {
const bar = new ProgressBar({
writable,
max: 10 * 1000,
refreshMilliseconds: 500,
interval: 500,
});
fakeTime.tick(3000);
bar.stop().then(() => writable.close());
Expand Down
Loading