![]() pipe(unzipper.Extract()) Parse a single file and pipe contents Installation $ npm install nextpoint-unzipper Quick Examples Extract to a directory fs.createReadStream('path/to/archive.zip') The Open methods will check for crx headers and parse crx files, but only if you provide crx: true in options. crx file with the streaming methods ( Parse and ParseOne). Please note: Methods that use the Central Directory instead of parsing entire file can be found under OpenĬhrome extension files (.crx) are zipfiles with an extra header at the start of the file. There are no added compiled dependencies - inflation is handled by node.js's built in zlib support. Unzipper provides simple APIs similar to node-tar for parsing and extracting zip files. Speeds up unzipping password protected zips by updating crc hashing using BigInt with minimal conversions between numbers and BigInts.Fixes unzipping from central directory (with unzipper.Open method) by fixing errors that occurred at ~40 entries to allow unzipping an entire zip file with this method.If (entry.This is an active fork of node-unzipper and addresses the following issues: fs.createReadStream('path/to/archive.zip') buffer function that consumes the entry by buffering the contents into memory and returning a promise to the complete buffer. While the recommended strategy of consuming the unzipped contents is using streams, it is sometimes convenient to be able to get the full buffered contents of each file. pipe(fs.createReadStream('firstFile.txt')) Buffering the content of an entry into memory If no file matches then the the stream will end without any content.Įxample: fs.createReadStream('path/to/archive.zip') Otherwise, each filename will be compared to the criteria and the first one to match will be unzipped and piped down. If no search criteria is specified, the first file in the archive will be unzipped. Unzipper.parseOne() is a convenience method that unzips only one file from the archive and pipes the contents down (not the entry itself). Installation $ npm install unzipper Quick Examples Extract to a directory fs.createReadStream('path/to/archive.zip') ![]() The new Parser will push any parsed entries downstream if you pipe from it, while still supporting the legacy entry event as well.īreaking changes: The new Parser will not automatically drain entries if there are no listeners or pipes in place. ![]() ![]() The structure of this fork is similar to the original, but uses Promises and inherit guarantees provided by node streams to ensure low memory footprint and emits finish/close events at the end of processing. Any files are buffered into memory before passing on to entry.finish/close events are not always triggered, particular when the input stream is slower than the receivers.This is an active fork and drop-in replacement of the node-unzip and addresses the following issues:
0 Comments
Leave a Reply. |