pnpm
Version:
A fast implementation of npm install
35 lines (22 loc) • 808 B
Markdown
# gunzip-maybe
Transform stream that gunzips its input if it is gzipped and just echoes it if not.
```
npm install gunzip-maybe
```
[](http://travis-ci.org/mafintosh/gunzip-maybe)
[](https://github.com/feross/standard)
## Usage
Simply pipe a gzipped (or not gzipped) stream to `gunzip()` and read the unzipped content.
``` js
// 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