Registry / devops / progress-gauge

progress-gauge

JSON →
library0.1.0jsnpmunverified

A zero-dependency terminal progress gauge renderer for Node.js (>=18) and browser environments, shipping TypeScript types. It renders deterministic progress bars from plain numbers or snapshot objects, supporting custom labels and widths. The package serves as a lightweight replacement for the abandoned `gauge` package, with a clean migration path. Current version 0.1.0 provides `renderGauge` for one-shot rendering and `createGauge` for persistent gauge instances with show/hide. No runtime dependencies, suitable for CLI tools and logging.

npm install progress-gauge
INSTALL
IMPORT
SIG · PROGRESS-GAUGE
P
progress-gauge
devopsjavascriptv0.1.0
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.

renderGauge
import { renderGauge } from 'progress-gauge'
const renderGauge = require('progress-gauge')
Package is ESM-only; do not use require() in Node.js CommonJS.
createGauge
import { createGauge } from 'progress-gauge'
Returns a Gauge instance with show/hide methods.
Gauge
import { Gauge } from 'progress-gauge'
import Gauge from 'progress-gauge'
Gauge is a named export, not default. Use named import.

Demonstrates one-shot rendering with renderGauge and persistent gauge with createGauge, including custom width and label.

import { renderGauge, createGauge } from 'progress-gauge'; // One-shot rendering const output = renderGauge({ completed: 0.42, label: 'install' }); console.log(output); // "install [########------------] 42%" // Persistent gauge instance const gauge = createGauge({ width: 30, label: 'download' }); gauge.show(0.5); // Wait... gauge.show(0.75); gauge.hide();
Debug
Known issues
gotchaPackage is ESM-only; require() will throw an error.
fix
Use import syntax or enable ESM in your project (e.g., "type": "module" in package.json).
affects: >=0.1.0
gotcharenderGauge returns a string, does not directly write to stdout.
fix
Use console.log() or process.stdout.write() on the returned string.
affects: >=0.1.0
gotchaNode.js 18+ required; older versions not supported.
fix
Upgrade to Node.js >= 18 or use a transpiler like esbuild.
affects: >=0.1.0
gotchaThe package is not affiliated with the original 'gauge' package; API differs slightly.
fix
Refer to migration guide (MIGRATION.md) for differences from 'gauge'.
affects: >=0.1.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/progress-gauge/index.mjs not supported.
Using require() to import an ESM-only package.
fix
Switch to import: `import { renderGauge } from 'progress-gauge'`
TypeError: renderGauge is not a function
Incorrect import or destructuring; e.g., using default import on named export.
fix
Ensure named import: `import { renderGauge } from 'progress-gauge'`
ReferenceError: exports is not defined
Using module.exports with CJS in an ESM context.
fix
Use `import` syntax and set `"type": "module"` in package.json.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
progress-gauge — npm install progress-gauge · libregistry