cli-progress is a robust and highly customizable library for displaying interactive progress bars in Node.js command-line and terminal applications. Currently stable at version 3.12.0, it sees active development with several releases per year, ensuring continuous improvement and bug fixes. Key features include full control over output formatting, support for both single and multiple concurrent progress bars, and the ability to define custom tokens for displaying additional data (payloads). It offers various presets for quick styling and operates without requiring callbacks, being designed as an externally controlled UI widget suitable for both asynchronous and synchronous tasks. Unlike many alternatives, its focus on external control provides flexibility, and it includes features like FPS limiting and TTY/NOTTY mode handling.
npm install cli-progressVerified import paths — ran on the pinned version, not inferred.
Demonstrates a single progress bar with custom formatting, colors (using 'ansi-colors'), and a dynamic payload token update.
Upgrade to v3.3.1 or higher. If you require synchronous multi-bar updates, thoroughly test your implementation on newer versions or consider alternative approaches for synchronization.
Ensure `ansi-colors` is installed in your project: `npm install ansi-colors` or `yarn add ansi-colors`.
Review any code that relies on specific large ETA display values. If precise display beyond the current limit is critical, consider implementing a custom ETA formatter.
Increase the `etaBuffer` option in the `SingleBar` or `MultiBar` constructor options to a value appropriate for your process's duration and update frequency.
Install the `ansi-colors` package: `npm install ansi-colors` or `yarn add ansi-colors`.
For ESM, use a default import for the main module object: `import cliProgress from 'cli-progress';` and then access `SingleBar` as a property: `new cliProgress.SingleBar(...)`. For CommonJS, use `const cliProgress = require('cli-progress');`.Ensure `start()` is called with a meaningful total, increase the `etaBuffer` option in the constructor for long-running tasks, and ensure regular updates to the progress value.