gunzip-maybe
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/gunzip-maybe package

1.4.2 • Public • Published

gunzip-maybe

Transform stream that gunzips its input if it is gzipped and just echoes it if not.

npm install gunzip-maybe

build status js-standard-style

Usage

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);

CLI usage

npm install -g gunzip-maybe
gunzip-maybe --help # will print out usage

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.4.2
    3,275,987
    • latest

Version History

Package Sidebar

Install

npm i gunzip-maybe

Weekly Downloads

3,284,432

Version

1.4.2

License

MIT

Unpacked Size

6.07 kB

Total Files

7

Last publish

Collaborators

  • mafintosh
  • watson