@aricart/nd-progress
v1.0.1
Published
A progress bar wrapper that runs in Deno and Node.js
Maintainers
Readme
nd-progress
A trivial progress bar wrapper for "jsr:@deno-library/progress" and "npm:cli-progress" that runs in Deno or Node.js with the same API. Note that configuration of the progress bars is very limited, as the intention is to provide cross-runtime support for a progress bar.
import { progressFactory } from "jsr:@aricart/nd-progress";
const progress = await progressFactory(100);
let n = 0;
const timer = setInterval(async () => {
await progress.update(++n);
if (n % 23 === 0) {
await progress.log(`hi ${n}`);
}
if (n % 42 === 0) {
await progress.message(`hello ${n}`);
}
if (n === 100) {
clearInterval(timer);
progress.stop();
}
}, 100);