Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

gunzip-maybe

1.4.1 • 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

Keywords

none

install

npm i gunzip-maybe

Downloadsweekly downloads

16,737

version

1.4.1

license

MIT

repository

githubgithub

last publish

collaborators

  • avatar
  • avatar