Mohammad Asif cf937194cb Removed un-waned things 1. | пре 6 месеци | |
---|---|---|
.. | ||
node_modules | пре 6 месеци | |
.travis.yml | пре 6 месеци | |
LICENSE | пре 6 месеци | |
README.md | пре 6 месеци | |
bin.js | пре 6 месеци | |
index.js | пре 6 месеци | |
package.json | пре 6 месеци | |
test.js | пре 6 месеци |
Transform stream that gunzips its input if it is gzipped and just echoes it if not.
npm install gunzip-maybe
Simply pipe a gzipped (or not gzipped) stream to gunzip([maxRecursion = 3])
and read the unzipped content.
maxRecursion
protects the unzip mechanism from an infinite recursion in case of a malicious archive.
// this will gunzip gzippedStream
gzippedStream.pipe(gunzip()).pipe(process.stdout);
// this will just echo plainTextStream
plainTextStream.pipe(gunzip()).pipe(process.stdout);
npm install -g gunzip-maybe
gunzip-maybe --help # will print out usage
MIT