Registry / testing / progress-bar-formatter

progress-bar-formatter

JSON →
library2.0.1jsnpmunverified

A lightweight progress bar formatter for Node.js that generates character-based progress bars. Version 2.0.1 is latest; no recent updates as of 2023. It supports custom complete/incomplete characters and bar length. Minimal API with one method. Differentiators: simple, synchronous, zero dependencies.

npm install progress-bar-formatter
INSTALL
IMPORT
SIG · PROGRESS-BAR-FORMA
P
progress-bar-formatter
testingjavascriptv2.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ProgressBarFormatter
const ProgressBarFormatter = require('progress-bar-formatter');
import ProgressBarFormatter from 'progress-bar-formatter';
CommonJS only; no default export for ESM.

Creates a progress bar formatter with custom characters and length, formats a progress value.

const ProgressBarFormatter = require('progress-bar-formatter'); const bar = new ProgressBarFormatter({ complete: '=', incomplete: ' ', length: 20 }); console.log(bar.format(0.45)); // ========= console.log(bar.format(1)); // ====================
Debug
Known issues
gotchaprogress parameter must be between 0 and 1; no validation or clamping.
fix
Clamp progress manually: Math.min(1, Math.max(0, progress))
affects: >=0.0.0
gotchadoes not output ANSI colors or cursor movement; plain text only.
fix
Use another package like 'progress' for terminal features.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: ProgressBarFormatter is not a constructor
Using ES import syntax on CommonJS module.
fix
Use require('progress-bar-formatter') instead of import.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
progress-bar-formatter — npm install progress-bar-formatter · libregistry