izaakschroeder / vinyl-s3

Use S3 as a source or destination of vinyl files.
20 stars 16 forks source link

Upload Progress #33

Closed cspicuzza closed 3 years ago

cspicuzza commented 7 years ago

I understand this isn't really an "issue". Is there a way to get vinyl-s3 to show the upload progress?

toddpi314 commented 7 years ago

If it helps, the file definition is at https://github.com/izaakschroeder/vinyl-s3/blob/master/lib/vinyl-stream.js#L27-L36

You could write your own progress indicator with something that monitors the through pipe:

const countTotal = ...
let downloaded = 0;
...
.pipe(through2.obj((file, enc, callback) => {
      downloaded++;
      // TODO: Display progress
      callback();
}))
...