{"id":16329139,"url":"https://github.com/deno-library/progress","last_synced_at":"2025-08-18T02:31:03.839Z","repository":{"id":38184554,"uuid":"267563522","full_name":"deno-library/progress","owner":"deno-library","description":"ProgressBar in terminal for deno","archived":false,"fork":false,"pushed_at":"2024-12-31T02:03:32.000Z","size":2228,"stargazers_count":68,"open_issues_count":2,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-28T19:47:07.332Z","etag":null,"topics":["deno","progress-bar"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deno-library.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-28T10:44:45.000Z","updated_at":"2025-07-18T15:01:22.000Z","dependencies_parsed_at":"2023-11-13T08:25:32.647Z","dependency_job_id":"461cac3c-c88b-4c3d-94b4-a8f02e169994","html_url":"https://github.com/deno-library/progress","commit_stats":{"total_commits":74,"total_committers":7,"mean_commits":"10.571428571428571","dds":0.5945945945945945,"last_synced_commit":"e9f7d14ff7c4b072fad9b3eb92ba0f6257e8ef64"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/deno-library/progress","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-library%2Fprogress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-library%2Fprogress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-library%2Fprogress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-library%2Fprogress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deno-library","download_url":"https://codeload.github.com/deno-library/progress/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-library%2Fprogress/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270933524,"owners_count":24670428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","progress-bar"],"created_at":"2024-10-10T23:14:42.471Z","updated_at":"2025-08-18T02:31:03.826Z","avatar_url":"https://github.com/deno-library.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# ProgressBar\n\nProgressBar in terminal for deno\n  \n[![JSR Version](https://jsr.io/badges/@deno-library/progress)](https://jsr.io/@deno-library/progress)\n[![deno.land/x/progress](https://deno.land/badge/progress/version)](https://deno.land/x/progress)\n[![LICENSE](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/deno-library/progress/blob/main/LICENSE)\n\n![logo](screenshots/logo.png)\n\n## Changelog\n\n[changelog](./changelog.md)\n\n## Usage\n\n### Multiple progress bars\n\n#### example\n\n```ts\nimport { MultiProgressBar } from \"jsr:@deno-library/progress\";\nimport { delay } from \"jsr:@std/async\";\n\n// or JSR (with version)\n// import { MultiProgressBar } from \"jsr:@deno-library/progress@1.5.1\";\n// import { delay } from \"jsr:@std/async@0.221.0\";\n\n// or JSR (no prefix, run `deno add @deno-library/progress` and `deno add @std/async`)\n// import { MultiProgressBar } from \"@deno-library/progress\";\n// import { delay } from \"@std/async\";\n\n// or\n// import { MultiProgressBar } from \"https://deno.land/x/progress@v1.5.1/mod.ts\";\n// import { delay } from \"https://deno.land/std@0.220.1/async/delay.ts\";\n\nconst title = \"download files\";\nconst total = 100;\n\nconst bars = new MultiProgressBar({\n  title,\n  // clear: true,\n  complete: \"=\",\n  incomplete: \"-\",\n  display: \"[:bar] :text :percent :time :completed/:total\",\n});\n\nlet completed1 = 0;\nlet completed2 = 0;\n\nasync function download() {\n  while (completed1 \u003c= total || completed2 \u003c= total) {\n    completed1 += 1;\n    completed2 += 2;\n    await bars.render([\n      {\n        completed: completed1,\n        total,\n        text: \"file1\",\n        complete: \"*\",\n        incomplete: \".\",\n      },\n      { completed: completed2, total, text: \"file2\" },\n    ]);\n\n    await delay(50);\n  }\n}\n\nawait download();\n```\n\n#### interface\n\n```ts\ninterface constructorOptions {\n  title?: string;\n  width?: number;\n  complete?: string;\n  incomplete?: string;\n  clear?: boolean;\n  interval?: number;\n  display?: string;\n  prettyTime?: boolean;\n  output?: typeof Deno.stdout | typeof Deno.stderr;\n}\n\ninterface renderOptions {\n  completed: number;\n  text?: string;\n  total?: number;\n  complete?: string;\n  incomplete?: string;\n  prettyTimeOptions?: prettyTimeOptions;\n}\n\n/**\n * prettyTime options\n * @param withSpaces Whether to use spaces to separate times, `1d2h3m5s` or `1d 2h 3m 5s`, default false\n * @param toFixedVal value pass to toFixed for seconds, default 1\n * @param longFormat Whether to use a long format, default false, `1d2h3m5s` or `1days 2hours 3minutes 5seconds`\n */\ninterface prettyTimeOptions {\n  withSpaces?: boolean;\n  toFixedVal?: number;\n  longFormat?: boolean;\n}\n\nclass MultiProgressBar {\n  /**\n   * Title, total, complete, incomplete, can also be set or changed in the render method\n   *\n   * @param title Progress bar title, default: ''\n   * @param width the displayed width of the progress, default: 50\n   * @param complete completion character, default: colors.bgGreen(' '), can use any string\n   * @param incomplete incomplete character, default: colors.bgWhite(' '), can use any string\n   * @param clear  clear the bar on completion, default: false\n   * @param interval  minimum time between updates in milliseconds, default: 16\n   * @param display  What is displayed and display order, default: ':bar :text :percent :time :completed/:total'\n   * @param prettyTime Whether to pretty print time and eta\n   * @param output Output stream, can be Deno.stdout or Deno.stderr, default is Deno.stdout\n   */\n  constructor(options: ConstructorOptions);\n\n  /**\n   * \"render\" the progress bar\n   *\n   * @param bars progress bars\n   * @param bars.completed` completed value\n   * @param bars.total optional, total number of ticks to complete, default: 100\n   * @param bars.text optional, text displayed per ProgressBar, default: ''\n   * @param bars.complete optional, completion character\n   * @param bars.incomplete optional, incomplete character\n   * @param bars.prettyTimeOptions optional, prettyTime options\n   */\n  render(bars: Array\u003crenderOptions\u003e): Promise\u003cvoid\u003e;\n\n  /**\n   * console: interrupt the progress bar and write a message above it\n   *\n   * @param message The message to write\n   */\n  console(message: string): Promise\u003cvoid\u003e;\n\n  /**\n   * end: end a progress bar.\n   * No need to call in most cases, unless you want to end before 100%\n   */\n  end(): Promise\u003cvoid\u003e;\n}\n```\n\n#### display\n\nWhat is displayed and display order, default: ':bar :text :percent :time\n:completed/:total'\n\n- `:bar` the progress bar itself\n- `:text` text displayed per ProgressBar\n- `:percent` completion percentage\n- `:time` time elapsed in seconds\n- `:eta` estimated completion time in seconds\n- `:total` total number of ticks to complete\n- `:completed` completed value\n\n### Single progress bar\n\n#### simple example\n\n```ts\nimport ProgressBar from \"jsr:@deno-library/progress\";\nimport { delay } from \"jsr:@std/async\";\n\n// or JSR (with version)\n// import ProgressBar from \"jsr:@deno-library/progress@1.5.1\";\n// import { delay } from \"jsr:@std/async@0.221.0\";\n\n// or JSR (no prefix, run `deno add @deno-library/progress` and `deno add @std/async`)\n// import ProgressBar from \"@deno-library/progress\";\n// import { delay } from \"@std/async\";\n\n// or\n// import ProgressBar from \"https://deno.land/x/progress@v1.5.1/mod.ts\";\n// import { delay } from \"@std/async/delay\";\n\nconst title = \"downloading:\";\nconst total = 100;\nconst progress = new ProgressBar({\n  title,\n  total,\n});\nlet completed = 0;\nasync function download() {\n  while (completed \u003c= total) {\n    await progress.render(completed++);\n\n    await delay(50);\n  }\n}\nawait download();\n```\n\n#### complex example\n\n```ts\nimport ProgressBar from \"jsr:@deno-library/progress\";\nimport { delay } from \"jsr:@std/async\";\n\n// or JSR (with version)\n// import ProgressBar from \"jsr:@deno-library/progress@1.5.1\";\n// import { delay } from \"jsr:@std/async@0.221.0\";\n\n// or JSR (no prefix, run `deno add @deno-library/progress` and `deno add @std/async`)\n// import ProgressBar from \"@deno-library/progress\";\n// import { delay } from \"@std/async\";\n\n// or\n// import ProgressBar from \"https://deno.land/x/progress@v1.5.1/mod.ts\";\n// import { delay } from \"@std/async/delay\";\n\nconst total = 100;\nconst progress = new ProgressBar({\n  total,\n  complete: \"=\",\n  incomplete: \"-\",\n  display: \":completed/:total hello :time [:bar] :percent\",\n  // or =\u003e\n  // display: ':bar'\n  // display: ':bar :time'\n  // display: '[:bar]'\n  // display: 'hello :bar world'\n  // ...\n});\nlet completed = 0;\nasync function download() {\n  while (completed \u003c= total) {\n    await progress.render(completed++);\n\n    await delay(50);\n  }\n}\nawait download();\n```\n\nMore examples in the `examples` folder.\n\n#### interface\n\n```ts\ninterface ConstructorOptions {\n  title?: string,\n  total?: number,\n  width?: number,\n  complete?: string,\n  preciseBar?: string[],\n  incomplete?: string,\n  clear?: boolean,\n  interval?: number,\n  display?: string\n  prettyTime?: boolean;\n  output?: typeof Deno.stdout | typeof Deno.stderr;\n}\n\ninterface renderOptions {\n  title?: string,\n  total?: number,\n  text?: string;\n  complete?: string,\n  preciseBar?: string[],\n  incomplete?: string,\n  prettyTimeOptions?: prettyTimeOptions;\n}\n\n/**\n * prettyTime options\n * @param withSpaces Whether to use spaces to separate times, `1d2h3m5s` or `1d 2h 3m 5s`, default false\n * @param toFixedVal value pass to toFixed for seconds, default 1\n * @param longFormat Whether to use a long format, default false, `1d2h3m5s` or `1days 2hours 3minutes 5seconds`\n */\ninterface prettyTimeOptions {\n  withSpaces?: boolean;\n  toFixedVal?: number;\n  longFormat?: boolean;\n}\n\nclass ProgressBar {\n  /**\n   * Title, total, complete, incomplete, can also be set or changed in the render method\n   *\n   * @param title progress bar title, default: ''\n   * @param total total number of ticks to complete\n   * @param width the displayed width of the progress, default: 50\n   * @param complete completion character, default: colors.bgGreen(' '), can use any string\n   * @param preciseBar in between character, default: [colors.bgGreen(' ')], can use any string array\n   * @param incomplete incomplete character, default: colors.bgWhite(' '), can use any string\n   * @param clear  clear the bar on completion, default: false\n   * @param interval  minimum time between updates in milliseconds, default: 16\n   * @param display  What is displayed and display order, default: ':title :percent :bar :time :completed/:total'\n   * @param prettyTime Whether to pretty print time and eta\n   * @param output Output stream, can be Deno.stdout or Deno.stderr, default is Deno.stdout\n   */\n  constructor(options: ConstructorOptions): void;\n\n  /**\n   * render: render the progress bar\n   *\n   * @param completed completed value\n   * @param options optional parameters\n   * @param options.title optional, progress bar title\n   * @param options.text optional, custom text, default: ''\n   * @param options.total optional, total number of ticks to complete, default: 100\n   * @param options.complete optional, completion character, If you want to change at a certain moment. For example, it turns red at 20%\n   * @param options.incomplete optional, incomplete character, If you want to change at a certain moment. For example, it turns red at 20%\n   * @param options.prettyTimeOptions optional, prettyTime options\n   */\n  render(completed: number, options? renderOptions): Promise\u003cvoid\u003e;\n\n  /**\n   * console: interrupt the progress bar and write a message above it\n   *\n   * @param message The message to write\n   */\n  console(message: string): Promise\u003cvoid\u003e;\n\n  /**\n   * end: end a progress bar.\n   * No need to call in most cases, unless you want to end before 100%\n   */\n  end(): Promise\u003cvoid\u003e;\n}\n```\n\n#### display\n\nWhat is displayed and display order, default: ':title :percent :bar :time\n:completed/:total'\n\n- `:title` progress bar title\n- `:percent` completion percentage\n- `:bar` the progress bar itself\n- `:time` time elapsed in seconds\n- `:eta` estimated completion time in seconds\n- `:completed` completed value\n- `:total` total number of ticks to complete\n\n## Screenshots\n\nStandard use\n\n![normal](./screenshots/title.gif)\n\nMulti-line progress bar output in terminal\n\n![normal](./screenshots/multi.gif)\n\nChange how the order and look of elements\n\n![console](./screenshots/display.gif)\n\nChange character color\n\n![console](./screenshots/changeColor.gif)\n\nChange background color\n\n![console](./screenshots/changeBgColor.gif)\n\nColor that changes with progress\n\n![console](./screenshots/colorProgression.gif)\n\nPrecise bar with more intermediate states\n\n![console](./screenshots/preciseBar.gif)\n\nWider bar\n\n![console](./screenshots/width.gif)\n\nClear the bar once finished\n\n![clear](./screenshots/clear.gif)\n\nBackward progress\n\n![backward](./screenshots/backward.gif)\n\nLog some messages\n\n![console](./screenshots/console.gif)\n\nLog some messages next to the bar\n\n![console](./screenshots/info.gif)\n\nMore screenshots in the `screenshots` folder.\n\n## Contributors\n\n\u003ca href=\"https://github.com/deno-library/progress/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=deno-library/progress\" /\u003e\n\u003c/a\u003e\n\nThanks for their contributions!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeno-library%2Fprogress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeno-library%2Fprogress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeno-library%2Fprogress/lists"}