Creating zip files

317 views
Skip to first unread message

Martin Cooper

unread,
Sep 6, 2012, 7:24:56 PM9/6/12
to nod...@googlegroups.com
Any good packages out there for creating zip files?

I found adm-zip, but that seems to create invalid archives, is
synchronous, and requires the entire archive contents to be buffered
in memory. I also found zipstream, but it doesn't look like it
supports directories, and it's not clear that it's being maintained.

Anything else out there that I've missed?

--
Martin Cooper

José F. Romaniello

unread,
Sep 6, 2012, 7:34:08 PM9/6/12
to nod...@googlegroups.com
would a tgz work for you?

2012/9/6 Martin Cooper <mfnc...@gmail.com>

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Scott González

unread,
Sep 6, 2012, 7:37:24 PM9/6/12
to nod...@googlegroups.com
We did a bunch of testing for jQuery UI and came to the same conclusion. However, we're successfully using a patched zipstream with success. Of course there is the concern of using something that is clearly not being maintained as the PR for this fix was sent 5 months ago and still hasn't landed. As far as I know we haven't run into any issues, but I can check with Rafael since he's the one working with it right now. The package seems small enough that it probably wouldn't be too hard to take over if the lack of maintenance continues.


Martin Cooper

unread,
Sep 6, 2012, 10:26:23 PM9/6/12
to nod...@googlegroups.com
On Thu, Sep 6, 2012 at 4:37 PM, Scott González <scott.g...@gmail.com> wrote:
> We did a bunch of testing for jQuery UI and came to the same conclusion.
> However, we're successfully using a patched zipstream with success. Of
> course there is the concern of using something that is clearly not being
> maintained as the PR for this fix was sent 5 months ago and still hasn't
> landed. As far as I know we haven't run into any issues, but I can check
> with Rafael since he's the one working with it right now. The package seems
> small enough that it probably wouldn't be too hard to take over if the lack
> of maintenance continues.

Thanks. With zipstream, do you know if there's a way to create
directories, and thus nest files? I don't see any support, looking at
both the API and the code, but I guess I could be missing it. That's
crucial for us.

As it turns out, we need to read zip files too, and I thought adm-zip
was working for that, but I just discovered that there's a showstopper
bug in the inflate code, so I'm stymied on that side too now.
zipstream only creates but doesn't read.

On Thu, Sep 6, 2012 at 4:34 PM, José F. Romaniello
<jfroma...@gmail.com> wrote:
> would a tgz work for you?

No, unfortunately. That would simplify things, for sure. The consumer
of these files needs them to be zips, though.

--
Martin Cooper

Scott González

unread,
Sep 6, 2012, 10:44:17 PM9/6/12
to nod...@googlegroups.com
On Thu, Sep 6, 2012 at 10:26 PM, Martin Cooper <mfnc...@gmail.com> wrote:
Thanks. With zipstream, do you know if there's a way to create
directories, and thus nest files? I don't see any support, looking at
both the API and the code, but I guess I could be missing it. That's
crucial for us.

I believe the directory support comes from just setting the path when calling .addFile().

zip.addFile( content, { name: "/some/deep/path.ext" }, callback );
 
As it turns out, we need to read zip files too, and I thought adm-zip
was working for that, but I just discovered that there's a showstopper
bug in the inflate code, so I'm stymied on that side too now.
zipstream only creates but doesn't read.

We're not reading zips, though our tests would be better if we were actually deflating the zip and verifying the contents. Right now we're just reaching into the code that's using zipstream and verifying that it's piping in the correct files.
Reply all
Reply to author
Forward
0 new messages