announcing 2 node modules for .zip files: yazl and yauzl

83 views
Skip to first unread message

Andrew Kelley

unread,
Oct 15, 2014, 7:38:55 PM10/15/14
to nod...@googlegroups.com
yazl - "yet another zip library" - https://github.com/thejoshwolfe/yazl
yauzl - "yet another unzip library" - https://github.com/thejoshwolfe/yauzl

Design principles:

 * Follow the spec. Don't scan for local file headers. Read the central directory for file metadata.
 * Don't block the JavaScript thread. Use and provide async APIs.
 * Never crash (if used properly). Don't let malformed zip files bring down client applications who are trying to catch errors.
 * Catch unsafe filenames entries. A zip file entry throws an error if its file name starts with "/" or /[A-Za-z]:\// or if it contains ".." path segments or "\\" (per the spec).
 * Keep memory usage under control. Don't attempt to buffer entire files in RAM at once.
 * Prefer to open input files one at a time than all at once. This is slightly suboptimal for time performance, but avoids OS-imposed limits on the number of simultaneously open file handles.

thejoshwolfe writes quality code. I've looked at all the modules available right now for creating and for reading .zip files, and these two are by far the most correct, efficient, and robust. These modules have been integrated and tested with groovebasin for some time now.

Enjoy!
Reply all
Reply to author
Forward
0 new messages