Skip to content

Commit

Permalink
Merge pull request #41 from jehna/fix/progress-bar
Browse files Browse the repository at this point in the history
Fix download progress bar magnitude
  • Loading branch information
jehna authored Aug 15, 2024
2 parents 665cbf5 + fffbeaf commit 3e894b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export function showProgress(stream: Readable) {
let bytes = 0;
let i = 0;
stream.on("data", (data) => {
if (i++ % 1000 !== 0) return;
bytes += data.length;
if (i++ % 1000 !== 0) return;
process.stdout.clearLine?.(0);
process.stdout.write(`\rDownloaded ${formatBytes(bytes)}`);
});
Expand Down

0 comments on commit 3e894b2

Please sign in to comment.