Thanks!

Basically zlib implements the "deflate" compression algorithm which is used
by the zip format. Then zip compresses each file individually and adds some
extra data with info like filenames and checksums. gzip just compresses a
single file, it's not an archiving format so you got to combine it with
somethling like tar. It's a different simpler format but it uses the same
deflate algorithm underneath.

Antoine
On Jan 31, 2012 4:46 PM, "Adam Crabtree" <[email protected]> wrote:

> Awesome work! I actually started using zipstream about 2 weeks ago. I see
> you added .pipe support, I shoehorned it into my local version since it
> wasn't there yet. =)
>
> Out of curiosity, I'm not familiar with zipping algorithms (packaging?),
> but is there any particular reason why you couldn't create or open a zip
> file using node's built in zlib module? (e.g., zlib.Gzip())
>
> I'm assuming there's some type of packaging going on since in order to
> open a tar file I seem to have to use Isaac's "tar" module.
>
> This is how npm does it:
> var stream =
> fs.createReadStream('in.tgz').pipe(zlib.Gunzip()).pipe(tar.Parse({type:
> "Directory"}))
>
> Cheers,
> Adam Crabtree
>
> On Mon, Jan 30, 2012 at 2:04 PM, Antoine van Wel <
> [email protected]> wrote:
>
>> I guess anything 0.6.X should be fine. Earlier versions won't work
>> since it depends on the zlib module.
>>
>>
>> Antoine
>>
>> On Mon, Jan 30, 2012 at 5:39 AM, Anand George <[email protected]>
>> wrote:
>> > Any specific reason for node >= 0.6.3
>> >
>> > Anand
>> >
>> >
>> > On Mon, Jan 30, 2012 at 9:54 AM, fent <[email protected]> wrote:
>> >>
>> >> Very nice. You took an interesting approach to streaming files into
>> >> it. I like.
>> >>
>> >> On Jan 26, 1:56 pm, Antoine van Wel <[email protected]> wrote:
>> >> > To install: npm install zipstream
>> >> >
>> >> > On github:https://github.com/wellawaretech/node-zipstream
>> >> >
>> >> > On Thu, Jan 26, 2012 at 9:43 PM, Antoine van Wel
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > <[email protected]> wrote:
>> >> > > Hi everybody,
>> >> >
>> >> > > I've put together a small module to create ZIP streams using Node's
>> >> > > internal Zlib library. It's accepting input streams as arguments
>> and
>> >> > > produces an output stream, so it's easy to generate files on the
>> fly.
>> >> >
>> >> > > var out = fs.createWriteStream('out.zip');
>> >> > > var zip = zipstream.createZip({ level: 1 });
>> >> >
>> >> > > zip.addFile(fs.createReadStream('README.md'), { name: 'README.md'
>> },
>> >> > > function() {
>> >> > >  zip.addFile(fs.createReadStream('example.js'), { name:
>> 'example.js'
>> >> > > }, function() {
>> >> > >    zip.finalize();
>> >> > >  });
>> >> > > });
>> >> >
>> >> > > zip.pipe(out);
>> >> >
>> >> > > enjoy,
>> >> >
>> >> > > Antoine.
>> >>
>> >> --
>> >> 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 [email protected]
>> >> To unsubscribe from this group, send email to
>> >> [email protected]
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/nodejs?hl=en?hl=en
>> >
>> >
>> > --
>> > 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 [email protected]
>> > To unsubscribe from this group, send email to
>> > [email protected]
>> > For more options, visit this group at
>> > http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>> --
>> 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 [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>
>
> --
> Better a little with righteousness
>        than much gain with injustice.
> Proverbs 16:8
>
> --
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to