const scan = out.progress("Scanning files");
for (const [index, file] of files.entries()) {
await lint(file);
scan.update({ done: index + 1, total: files.length });
}
scan.stop();Nothing shows for a step that ends within two seconds. After that, progress goes to stderr, so stdout stays the answer.
Terminal
Scanning files ██████████████████░░░░░░░░░░░░ 60% ~4s leftCI or a pipe
Scanning files: 128 of 212 files, 60%, ~4s leftAt a terminal it is one line, rewritten in place and cleared on stop(). Off a terminal, a new line every five seconds. Agents, --format json, --format jsonl and --quiet get no progress.
scan.update({ done: 3, total: 10, doneBytes: 120_000_000, totalBytes: 400_000_000 });With bytes, the share and the time left follow the bytes.
Without createOut
Section titled "Without createOut"import { createProgress } from "readerly/progress";
const bar = createProgress("Downloading", { unit: "packages", shortLabel: "Dl" });createProgress takes the stream, the clock, a shortLabel for a narrow terminal, an intro line printed once off a terminal, and the unit its lines count, files by default.