Stuk / jszip-utils

Other
230 stars 193 forks source link

Allow progress info while downloading #14

Closed GuillaumeLeclerc closed 5 years ago

GuillaumeLeclerc commented 8 years ago

The XHR object allow you to know the progess of the download. It might be a good thing to be able to access it using this.

victornpb commented 7 years ago

I implemented this on a fork https://github.com/Stuk/jszip-utils/pull/19 and submitted it as a PR.

ufukomer commented 5 years ago

Is not there any solution for this yet?

Stuk commented 5 years ago

Just a bit of a delay. I've reviewed the PR.

Stuk commented 5 years ago

Released as version v0.1.0.

Pass an options object with a progress callback:

JSZipUtils.getBinaryContent("ref/amount.txt", {
    progress: function(e) {
        console.log(e.percent + "% loaded");
    },
    callback: function (err, data) {
        // ...
    }
});