-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Use yazl
instead of JSZip
#42
Conversation
Here are some benchmarks using this file https://gist.github.com/kevva/54d8c3d62a2bba256df8:
|
@kevva You told me to wait on merging this, but I can't remember the reason? Merge conflict also needs to be fixed. |
It seems to work fine by looking at the tests. I remember trying to extract the file using the archive manager on Ubuntu and it failed for some reason though. Using |
@kevva Any open issue on I don't want to use it if it has bugs as I will have to deal with them and JSZip seems to be working ok. |
Nope, but I keep getting random |
Vote for yazl! @kevva I ran into the same issue that my zip cannot be unzip properly |
Also adds a test to check whether the zip has been created successfully or not. Fixes #38.
@sindresorhus, I think this should be fine now. Tested and it seems to work with the Archive Manager (in Ubuntu) too. |
It seems that OS X's issue has been fixed hours ago. It's time to merge this PR! |
💃 More than 4x speed improvement! |
|
||
cb(); | ||
zip.end(function () { | ||
zip.outputStream.pipe(concatStream(function (data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't have to wait until the end callback to pipe the output stream. in fact, you can skip the zip.end function entirely - it's just to notify you when it knows the final size of the zip file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do think it's needed. I get timeout issues otherwise when running tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh sorry, you do need to call it. but you don't need to wait for the callback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data becomes available in this stream soon after calling one of addFile(), addReadStream(), or
addBuffer(). Clients can call pipe() on this stream at any time, such as immediately after getting
a new ZipFile instance, or long after calling end().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, makes no difference in speed or whatsoever though since we're only handling one buffer at a time.
Could we update yazl to version 2.2.1 since it fixed on OS X |
@rickychien, |
Also adds a test to check whether the zip has been created successfully or not by checking the contents.