Skip to content

Commit

Permalink
Fix download progress bar size
Browse files Browse the repository at this point in the history
Was counting wrong one order of magnitude
  • Loading branch information
jehna committed Aug 15, 2024
1 parent 665cbf5 commit fffbeaf
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 fffbeaf

Please sign in to comment.