ProgressStatus

The ProgressStatus type defines the possible states of a progress bar in ts-better-console. It represents where the progress bar is in its lifecycle, from actively running to completed, cancelled, or errored.

Type Definition

The ProgressStatus type accepts the following string values:

  • "active": The progress bar is currently running and accepting updates.
  • "completed": The progress bar has reached 100% and finished successfully.
  • "cancelled": The progress bar was manually cancelled before completion.
  • "errored": The progress bar encountered an error and stopped.
type ProgressStatus = "active" | "completed" | "cancelled" | "errored";

Usage

You can check the ProgressStatus to determine the current state of a progress bar:

import { Progress } from "ts-better-console";

const bar = new Progress("Loading", 100);

// Check the status of the progress bar
if (bar.status === "active") {
console.log("Still in progress...");
}

if (bar.status === "completed") {
console.log("All done!");
}

Want to support this project?

If you find ts-better-console useful and want to support its development, consider starring the GitHub repository or buying me a coffee! Your support helps me dedicate more time to improving the library and adding new features.

Want to contribute to this project?

Contributions are welcome! If you're interested in improving the library, fixing bugs, or adding new features, feel free to check out the GitHub repository and submit a pull request. Whether you're a seasoned developer or new to open source, your contributions can make a difference!