Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added progress events, w/ test #39

Closed
wants to merge 4 commits into from
Closed

Conversation

prust
Copy link
Contributor

@prust prust commented Dec 10, 2014

We needed to give the user progress notifications when extracting large zips, so they don't give up or think it is stuck. It's a small change, but may prove useful for others.

I'm not super-familiar with the codebase or with promises, but I think this should do the trick. I added a test & it passes.

Note that if #37 reduces the number of files in the first test zip file (as requested in #32 (comment) ?), then the numTotalFiles variable in the test will need to be adjusted.

@prust
Copy link
Contributor Author

prust commented Dec 10, 2014

Decompress-zip does not extract the files in order (due to parallel processing?), so the indexes I was getting from forEach() were not sequential, which is not very useful as an indicator of unzip progress. I changed the progress event in 2ab824c to return sequential fileIndexs.

The only downside is that this loses the actual index of the file that was just processed, which may have matched the index of the file in the array returned by .list().

@prust
Copy link
Contributor Author

prust commented Jan 5, 2015

thanks @sindresorhus -- and thank you for all your work maintaining this project over the weekend, it is much appreciated.

@prust prust deleted the progress-evts branch January 5, 2015 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant