{"_id":"@1-/bar","name":"@1-/bar","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@1-/bar","version":"0.1.0","description":"TTY-aware command-line progress bar and status display utility","description_zh":"TTY 感知的命令行进度条及状态显示工具","keywords":["progress","bar","cli","tty","spinner"],"homepage":"https://github.com/webc-site/npm/tree/main/bar","license":"MulanPSL-2.0","author":{"name":"x-at-01@googlegroups.com"},"repository":{"type":"git","url":"git+https://github.com/webc-site/npm.git"},"type":"module","exports":{".":"./_.js","./*":"./*"},"_id":"@1-/bar@0.1.0","bugs":{"url":"https://github.com/webc-site/npm/issues"},"_nodeVersion":"26.2.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-PmOoFePtt0q150MbTvUBytNFOVAvZ0aTor95dqRjrnVXJRMVGGdtXkKJ1XjKybIlJgxRIpnhp9NXOhIR6+FShw==","shasum":"b7f7e204ce348ca9ff67ca326deac8b04bf50834","tarball":"https://registry.npmjs.org/@1-/bar/-/bar-0.1.0.tgz","fileCount":3,"unpackedSize":7461,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGfxOkzgs6zhcItoavJ1eP4hpLAqp3wBdQ8L8Wt/pzgsAiEAqjnnVwKfn1/+w1U6on6BCKBUrN5kbq3EORMQJ6f7M20="}]},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"directories":{},"maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bar_0.1.0_1782389396645_0.8337503302148503"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-25T12:09:56.430Z","0.1.0":"2026-06-25T12:09:56.783Z","modified":"2026-06-25T12:09:57.141Z"},"maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"description":"TTY-aware command-line progress bar and status display utility","homepage":"https://github.com/webc-site/npm/tree/main/bar","keywords":["progress","bar","cli","tty","spinner"],"repository":{"type":"git","url":"git+https://github.com/webc-site/npm.git"},"author":{"name":"x-at-01@googlegroups.com"},"bugs":{"url":"https://github.com/webc-site/npm/issues"},"license":"MulanPSL-2.0","readme":"[English](#en) | [中文](#zh)\n\n---\n\n<a id=\"en\"></a>\n# @1-/bar : TTY-aware command-line progress bar and status display\n\n- [@1-/bar : TTY-aware command-line progress bar and status display](#1-bar-tty-aware-command-line-progress-bar-and-status-display)\n  - [Functionality](#functionality)\n  - [Usage demonstration](#usage-demonstration)\n  - [Design rationale](#design-rationale)\n  - [Technology stack](#technology-stack)\n  - [Code structure](#code-structure)\n  - [Historical background](#historical-background)\n  - [About](#about)\n\n## Functionality\nTTY-aware command-line progress bar and status display utility for Node.js applications. Provides spinner animation, task tracking, ETA estimation, and safe logging that doesn't disrupt the display.\n\n## Usage demonstration\n```bash\nnpm install @1-/bar\n```\n\n```javascript\nimport bar from '@1-/bar';\n\nconst [start, stop, incr, log] = bar();\n\n// Start progress bar with total tasks\nstart(100);\n\n// Log subtasks\nlog.start('Processing files');\n\n// Increment progress\nfor (let i = 0; i < 100; i++) {\n  incr();\n  // Simulate work\n  await new Promise(resolve => setTimeout(resolve, 10));\n}\n\nlog.end('Processing files');\nstop();\n```\n\n## Design rationale\nThe implementation uses terminal escape sequences for efficient rendering without disrupting the display. It maintains state for progress tracking, task management, and timing calculations for ETA estimation.\n\n![](https://fastly.jsdelivr.net/gh/webc-fs/-@2C/CVgwpu5Bvif7s62m-qAw.svg)\n\n## Technology stack\n- Node.js runtime\n- Standard JavaScript modules\n- Terminal escape sequences for TTY control\n- Set data structure for task tracking\n\n## Code structure\n```\nsrc/\n├── _.js          # Main module exporting progress utilities\n```\n\n## Historical background\nThe Mulan Public Software License (MulanPSL) is an open-source license developed in China, designed to be compatible with international open-source practices while addressing local legal requirements. Version 2.0, released in 2020, improved compatibility with other licenses and clarified terms for patent grants and trademark usage.\n\n## About\n\nThis library is developed by [WebC.site](https://webc.site).\n\n[WebC.site](https://webc.site): A new paradigm of web development for AI\n\n\n---\n\n<a id=\"zh\"></a>\n# @1-/bar : TTY 感知的命令行进度条及状态显示\n\n- [@1-/bar : TTY 感知的命令行进度条及状态显示](#1-bar-tty-感知的命令行进度条及状态显示)\n  - [功能介绍](#功能介绍)\n  - [使用演示](#使用演示)\n  - [设计思路](#设计思路)\n  - [技术栈](#技术栈)\n  - [代码结构](#代码结构)\n  - [历史故事](#历史故事)\n  - [关于](#关于)\n\n## 功能介绍\nTTY 感知的命令行进度条及状态显示工具，适用于 Node.js 应用程序。提供旋转动画、任务跟踪、ETA 预估及安全日志输出功能，确保日志不会破坏进度条显示。\n\n## 使用演示\n```bash\nnpm install @1-/bar\n```\n\n```javascript\nimport bar from '@1-/bar';\n\nconst [start, stop, incr, log] = bar();\n\n// 启动进度条并设置总任务数\nstart(100);\n\n// 记录子任务\nlog.start('处理文件');\n\n// 增加已完成任务数\nfor (let i = 0; i < 100; i++) {\n  incr();\n  // 模拟工作\n  await new Promise(resolve => setTimeout(resolve, 10));\n}\n\nlog.end('处理文件');\nstop();\n```\n\n## 设计思路\n实现采用终端转义序列进行高效渲染，避免显示中断。维护进度跟踪、任务管理及时间计算状态，支持 ETA（预估完成时间）估算。\n\n![](https://fastly.jsdelivr.net/gh/webc-fs/-@HQ/cbaDLo0WM3BrA4innS6Q.svg)\n\n## 技术栈\n- Node.js 运行时\n- 标准 JavaScript 模块\n- 终端转义序列实现 TTY 控制\n- Set 数据结构进行任务跟踪\n\n## 代码结构\n```\nsrc/\n├── _.js          # 主模块，导出进度工具函数\n```\n\n## 历史故事\n木兰公共许可证（MulanPSL）是中国开发的开源许可证，旨在兼容国际开源实践同时满足本地法律要求。2.0 版本于 2020 年发布，提升了与其他许可证的兼容性，并明确了专利授权和商标使用条款。\n\n## 关于\n\n本库由 [WebC.site](https://webc.site) 开发。\n\n[WebC.site](https://webc.site) : 面向人工智能的网站开发新范式\n\n","readmeFilename":"README.md","_rev":"1-5584e1d30ab5d56ae49c4fcb326f760b"}