{"id":13846831,"url":"https://github.com/bubkoo/ascii-progress","last_synced_at":"2025-04-08T09:09:45.174Z","repository":{"id":47959247,"uuid":"52981324","full_name":"bubkoo/ascii-progress","owner":"bubkoo","description":"🍓 Ascii progress-bar(s) in the terminal.","archived":false,"fork":false,"pushed_at":"2025-01-01T03:22:46.000Z","size":7007,"stargazers_count":211,"open_issues_count":21,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T08:37:08.918Z","etag":null,"topics":["ascii","nodejs","progress","progress-bar"],"latest_commit_sha":null,"homepage":"","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/bubkoo.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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-02T17:12:11.000Z","updated_at":"2025-03-21T18:52:54.000Z","dependencies_parsed_at":"2024-06-18T15:32:25.038Z","dependency_job_id":"8ebe5d86-d09f-4ae8-8250-4b47dd4b2186","html_url":"https://github.com/bubkoo/ascii-progress","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubkoo%2Fascii-progress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubkoo%2Fascii-progress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubkoo%2Fascii-progress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubkoo%2Fascii-progress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bubkoo","download_url":"https://codeload.github.com/bubkoo/ascii-progress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247809964,"owners_count":20999816,"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","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":["ascii","nodejs","progress","progress-bar"],"created_at":"2024-08-04T18:00:48.575Z","updated_at":"2025-04-08T09:09:45.156Z","avatar_url":"https://github.com/bubkoo.png","language":"TypeScript","funding_links":[],"categories":["JavaScript"],"sub_categories":["Node"],"readme":"\u003ch1 align=\"center\"\u003eascii-progress\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003eAscii progress-bar(s) in the terminal.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/bubkoo/ascii-progress?style=flat-square\" alt=\"MIT License\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.typescriptlang.org\"\u003e\u003cimg alt=\"Language\" src=\"https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/bubkoo/ascii-progress/pulls\"\u003e\u003cimg alt=\"PRs Welcome\" src=\"https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square\"\u003e\u003c/a\u003e\n\n\u003c/p\u003e\n\n**Features**:\n\n- Support multi progress-bars.\n- Relative and absolute width.\n- Colorful bar and text.\n- Highly customizable.\n\n\n![snapshot](snapshot.gif)\n\n\n## Install\n\n```\n$ npm install ascii-progress\n```\n\n## Usage\n\n\u003e For more usage see the [examples](https://github.com/bubkoo/ascii-progress/blob/master/examples)\n\n```javascript\nconst { ProgressBar } = require('ascii-progress');\n\nconst bar = new ProgressBar({\n    schema: ':bar',\n    total : 10,\n});\n\nconst iv = setInterval(function () {\n  bar.tick();\n  if (bar.completed) {\n    clearInterval(iv);\n  }\n}, 100);\n```\n\n\n### Options\n\nThese are keys in the options object you can pass to the progress bar along with `total` as seen in the example above.\n\n- `schema` - template string of the progress bar. Default `\" [:bar] :current/:total :percent :elapseds :etas'\"`.\n- `total` - total number of ticks to complete. Default `100`.\n- `current`- number of completed ticks. Default `0`.\n- `width` - display width, percentage or less than `1` is relative the terminal's width. Default `60`.\n- `fixedWidth` - do not adjust the bar based on the terminal size\n- `filled`- completion character. Default `\"▇\"`.\n- `blank` - blank character. Default `\"-\"`.\n- `clean` - clear the progress bar on completion. Default `false`.\n- `callback` -  optional function to call when the progress bar completes.\n\n\n### Properties\n - `schema`\n - `total`\n - `current`\n - `completed`\n\n### Methods\n\n- `setSchema(schema, refresh/tokens)` - Update the schema of the progress bar. If `refresh` or `tokens` is truely the progress bar will be refreshed.\n- `tick(delta, tokens)` - Update ticks of the progress bar by `delta`, then render the progress bar with optional `tokens`.\n- `update(ratio, tokens)` - Update the progress bar to `ratio` by percentage, then render the progress bar with optional `tokens`.\n\n- `clear()` - Clean the progress bar in the terminal.\n\n## Schema\n\nThe schema defines appearance the progress bar. Few inner tokens and many formatting methods can be used to customer you progress bar.\n\n### Tokens\n\nThese are tokens you can use in the format of your progress bar.\n\n- `:filled` Completed part of the progress bar.\n- `:blank` Blank part of  the progress bar.\n- `:bar` Whole progress bar, equal to `:completed:blank`.\n- `:current` Current tick number.\n- `:total` Total ticks.\n- `:percent` Completion percentage.\n- `:elapsed` Time elapsed in seconds.\n- `:eta` Estimated completion time in seconds.\n\n### Custom Tokens\n\nYou can define custom tokens by adding a `{name: value}` object parameter to your method (`tick()`, `update()`, etc.) calls.\n\n```javascript\nconst bar = new ProgressBar({\n    schema: ':current: :token1 :token2',\n    total : 3,\n});\nbar.tick({\n  'token1': \"Hello\",\n  'token2': \"World!\"\n})\nbar.tick(2, {\n  'token1': \"Goodbye\",\n  'token2': \"World!\"\n})\n```\n\nThe above example would result in the output below.\n\n```\n1: Hello World!\n3: Goodbye World!\n```\n\n### Colors\n\nColor names can be use in schema:\n\n```\n:bar.red :percent.green\n```\n\nThen the progress bar will be red, and the percentage will be green.\n\nAll available color names:\n\n- red\n- cyan\n- blue\n- grey\n- white\n- black\n- green\n- yellow\n- magenta\n- brightRed\n- brightBlue\n- brightCyan\n- brightWhite\n- brightBlack\n- brightGreen\n- brightYellow\n- brightMagenta\n\nAnd with the `bg` prefix, such as `bgRed`, the color will be applied to the background.\n\n```\n:bar.red.bgBlue\n```\n\nThe above progress bar has blue background and red foreground.\n\n### Gradient\n\n```\n:bar.gradient(red,blue)\n```\n\nThe arguments can be color names or hex color:\n\n- red\n- cyan\n- blue\n- grey\n- white\n- black\n- green\n- yellow\n- magenta\n- \\#xxxxxx\n\n\n### Font style\n\nSame as color names, font style can also be assigned by name:\n\n- bold\n- italic\n- inverse\n- underline\n\n```\n:bar.red :percent.green.bold\n```\n\nThe percentage is green and bold.\n\n\n## Contributing\n\nPlease let us know how can we help. Do check out [issues](https://github.com/bubkoo/ascii-progress/issues) for bug reports or suggestions first.\n\nTo become a contributor, please follow our [contributing guide](/CONTRIBUTING.md).\n\n\u003ca href=\"https://github.com/bubkoo/ascii-progress/graphs/contributors\"\u003e\n  \u003cimg src=\"/CONTRIBUTORS.svg\" alt=\"Contributors\" width=\"740\" /\u003e\n\u003c/a\u003e\n\n\n## License\n\nThe scripts and documentation in this project are released under the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubkoo%2Fascii-progress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbubkoo%2Fascii-progress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubkoo%2Fascii-progress/lists"}