{"id":13396676,"url":"https://github.com/visionmedia/node-progress","last_synced_at":"2025-12-17T10:55:14.840Z","repository":{"id":40533537,"uuid":"1643317","full_name":"visionmedia/node-progress","owner":"visionmedia","description":"Flexible ascii progress bar for nodejs","archived":false,"fork":false,"pushed_at":"2023-02-13T23:42:44.000Z","size":136,"stargazers_count":2986,"open_issues_count":71,"forks_count":222,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-05-08T20:17:59.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/visionmedia.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":"2011-04-21T01:09:35.000Z","updated_at":"2025-05-03T18:30:22.000Z","dependencies_parsed_at":"2024-05-16T06:29:17.476Z","dependency_job_id":"38683911-d6ed-4189-9fe0-566e77b95fbc","html_url":"https://github.com/visionmedia/node-progress","commit_stats":{"total_commits":100,"total_committers":40,"mean_commits":2.5,"dds":0.83,"last_synced_commit":"0790207ef077cbfb7ebde24a1dd9895ebf4643e1"},"previous_names":["tj/node-progress"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visionmedia%2Fnode-progress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visionmedia%2Fnode-progress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visionmedia%2Fnode-progress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visionmedia%2Fnode-progress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/visionmedia","download_url":"https://codeload.github.com/visionmedia/node-progress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253528970,"owners_count":21922635,"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":[],"created_at":"2024-07-30T18:00:59.830Z","updated_at":"2025-12-17T10:55:14.764Z","avatar_url":"https://github.com/visionmedia.png","language":"JavaScript","readme":"Flexible ascii progress bar.\n\n## Installation\n\n```bash\n$ npm install progress\n```\n\n## Usage\n\nFirst we create a `ProgressBar`, giving it a format string\nas well as the `total`, telling the progress bar when it will\nbe considered complete. After that all we need to do is `tick()` appropriately.\n\n```javascript\nvar ProgressBar = require('progress');\n\nvar bar = new ProgressBar(':bar', { total: 10 });\nvar timer = setInterval(function () {\n  bar.tick();\n  if (bar.complete) {\n    console.log('\\ncomplete\\n');\n    clearInterval(timer);\n  }\n}, 100);\n```\n\n### Options\n\nThese are keys in the options object you can pass to the progress bar along with\n`total` as seen in the example above.\n\n- `curr` current completed index\n- `total` total number of ticks to complete\n- `width` the displayed width of the progress bar defaulting to total\n- `stream` the output stream defaulting to stderr\n- `head` head character defaulting to complete character\n- `complete` completion character defaulting to \"=\"\n- `incomplete` incomplete character defaulting to \"-\"\n- `renderThrottle` minimum time between updates in milliseconds defaulting to 16\n- `clear` option to clear the bar on completion defaulting to false\n- `callback` optional function to call when the progress bar completes\n\n### Tokens\n\nThese are tokens you can use in the format of your progress bar.\n\n- `:bar` the progress bar itself\n- `:current` current tick number\n- `:total` total ticks\n- `:elapsed` time elapsed in seconds\n- `:percent` completion percentage\n- `:eta` estimated completion time in seconds\n- `:rate` rate of ticks per second\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\nvar bar = new ProgressBar(':current: :token1 :token2', { total: 3 })\nbar.tick({\n  'token1': \"Hello\",\n  'token2': \"World!\\n\"\n})\nbar.tick(2, {\n  'token1': \"Goodbye\",\n  'token2': \"World!\"\n})\n```\nThe above example would result in the output below.\n\n```\n1: Hello World!\n3: Goodbye World!\n```\n\n## Examples\n\n### Download\n\nIn our download example each tick has a variable influence, so we pass the chunk\nlength which adjusts the progress bar appropriately relative to the total\nlength.\n\n```javascript\nvar ProgressBar = require('progress');\nvar https = require('https');\n\nvar req = https.request({\n  host: 'download.github.com',\n  port: 443,\n  path: '/visionmedia-node-jscoverage-0d4608a.zip'\n});\n\nreq.on('response', function(res){\n  var len = parseInt(res.headers['content-length'], 10);\n\n  console.log();\n  var bar = new ProgressBar('  downloading [:bar] :rate/bps :percent :etas', {\n    complete: '=',\n    incomplete: ' ',\n    width: 20,\n    total: len\n  });\n\n  res.on('data', function (chunk) {\n    bar.tick(chunk.length);\n  });\n\n  res.on('end', function () {\n    console.log('\\n');\n  });\n});\n\nreq.end();\n```\n\nThe above example result in a progress bar like the one below.\n\n```\ndownloading [=====             ] 39/bps 29% 3.7s\n```\n\n### Interrupt\n\nTo display a message during progress bar execution, use `interrupt()`\n```javascript\nvar ProgressBar = require('progress');\n\nvar bar = new ProgressBar(':bar :current/:total', { total: 10 });\nvar timer = setInterval(function () {\n  bar.tick();\n  if (bar.complete) {\n    clearInterval(timer);\n  } else if (bar.curr === 5) {\n      bar.interrupt('this message appears above the progress bar\\ncurrent progress is ' + bar.curr + '/' + bar.total);\n  }\n}, 1000);\n```\n\nYou can see more examples in the `examples` folder.\n\n## License\n\nMIT\n","funding_links":[],"categories":["打印","Packages","JavaScript","3. Engineering","Repository","GIT 仓库","Uncategorized","Node.js / JavaScript 🟨","包",":file_folder: Browser"],"sub_categories":["Command-line utilities","3.1. Cli Tools","Command-line Utilities","命令行工具","Uncategorized","命令行实用工具","Components"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisionmedia%2Fnode-progress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvisionmedia%2Fnode-progress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisionmedia%2Fnode-progress/lists"}