MCPcopy Create free account
hub / github.com/denoland/std / stop

Method stop

cli/unstable_progress_bar.ts:296–310  ·  view source on GitHub ↗

* Ends the progress bar and cleans up any lose ends. * * @example Usage * ```ts ignore * import { ProgressBar } from "@std/cli/unstable-progress-bar"; * * const progressBar = new ProgressBar({ max: 100 }); * await progressBar.stop() * ```

()

Source from the content-addressed store, hash-verified

294 * ```
295 */
296 async stop(): Promise<void> {
297 clearInterval(this.#id);
298 try {
299 if (this.#clear) {
300 await this.#writer.write(LINE_CLEAR);
301 } else {
302 await this.#print();
303 await this.#writer.write("\n");
304 }
305 await this.#writer.close();
306 await this.#pipePromise;
307 } catch {
308 // ignore
309 }
310 }
311}

Callers

nothing calls this directly

Calls 3

#printMethod · 0.95
writeMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected