A lightweight, customizable progress bar library for terminal applications with zero dependencies.
- 🚀 Zero dependencies
- 🎨 Customizable colors and styles
- 📊 Multiple progress bar formats
- ⚡ High performance
- 🔧 Simple API
- 📦 Tiny footprint (~5KB)
npm install progbarconst ProgressBar = require('progbar');
const bar = new ProgressBar({
total: 100,
width: 40,
format: '[{bar}] {percentage}% | ETA: {eta}s'
});
// Update progress
for (let i = 0; i <= 100; i++) {
bar.update(i);
}total(number): Total number of stepswidth(number): Width of the progress bar (default: 40)format(string): Format string with tokenscomplete(string): Character for completed portion (default: '█')incomplete(string): Character for incomplete portion (default: '░')clear(boolean): Clear bar on completion (default: false)
{bar}- The progress bar{percentage}- Completion percentage{current}- Current value{total}- Total value{eta}- Estimated time remaining{elapsed}- Elapsed time
update(current)- Update progress to current valuetick(amount)- Increment progress by amount (default: 1)complete()- Mark as completestop()- Stop and clear the bar
const bar = new ProgressBar({ total: 100 });
bar.update(50); // 50% completeconst bar = new ProgressBar({
total: 100,
format: 'Progress: [{bar}] {current}/{total} ({percentage}%)'
});const bar = new ProgressBar({
total: 100,
complete: '=',
incomplete: '-',
format: '[{bar}] {percentage}%'
});const bar = new ProgressBar({
total: 100,
complete: '\x1b[32m█\x1b[0m', // Green
incomplete: '\x1b[90m░\x1b[0m', // Gray
format: '[{bar}] {percentage}%'
});MIT