From 0d00de1817b498f85497a6690d74e6dbc16ff446 Mon Sep 17 00:00:00 2001 From: timreichen Date: Mon, 13 Apr 2026 17:48:53 +0200 Subject: [PATCH] initial commit --- cli/unstable_progress_bar.ts | 12 ++++++------ cli/unstable_progress_bar_test.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/unstable_progress_bar.ts b/cli/unstable_progress_bar.ts index 5ab0a7b20361..b615a3b71faf 100644 --- a/cli/unstable_progress_bar.ts +++ b/cli/unstable_progress_bar.ts @@ -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"; @@ -223,7 +223,7 @@ export class ProgressBar { clear = false, formatter = defaultFormatter, keepOpen = true, - refreshMilliseconds = 1000, + interval = 1000, } = options; this.value = value; this.max = max; @@ -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() { diff --git a/cli/unstable_progress_bar_test.ts b/cli/unstable_progress_bar_test.ts index ca41a079f731..598ac3f6d25c 100644 --- a/cli/unstable_progress_bar_test.ts +++ b/cli/unstable_progress_bar_test.ts @@ -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());