# gunzip-maybe

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

Latest version **1.4.2** (published 2020-04-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install gunzip-maybe
pnpm add gunzip-maybe
yarn add gunzip-maybe
bun add gunzip-maybe
```

Provides the command `gunzip-maybe`.

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.2 |
| Published | 2020-04-22 |
| First published | 2014-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/gunzip-maybe) |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 108 |
| Author | Mathias Buus |
| Maintainers | mafintosh, watson |

## Links

- npm: https://www.npmjs.com/package/gunzip-maybe
- Repository: https://github.com/mafintosh/gunzip-maybe
- Issues: https://github.com/mafintosh/gunzip-maybe/issues
- npm.io page: https://npm.io/package/gunzip-maybe

## Dependencies (6)

- [is-gzip](https://npm.io/package/is-gzip.md) ^1.0.0
- [pumpify](https://npm.io/package/pumpify.md) ^1.3.3
- [through2](https://npm.io/package/through2.md) ^2.0.3
- [is-deflate](https://npm.io/package/is-deflate.md) ^1.0.0
- [peek-stream](https://npm.io/package/peek-stream.md) ^1.1.0
- [browserify-zlib](https://npm.io/package/browserify-zlib.md) ^0.1.4

## Recent versions

- 1.4.2 (latest) — 2020-04-22
- 1.4.1 — 2017-07-07
- 1.4.0 — 2017-03-01
- 1.3.1 — 2016-01-23
- 1.3.0 — 2016-01-17
- 1.2.1 — 2015-06-15
- 1.2.0 — 2015-05-15
- 1.1.0 — 2014-11-03
- 1.0.3 — 2014-10-08
- 1.0.2 — 2014-07-24
- 1.0.1 — 2014-07-23
- 1.0.0 — 2014-05-07
- 0.0.0 — 2014-05-07

## README

# gunzip-maybe

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

```
npm install gunzip-maybe
```

[![build status](http://img.shields.io/travis/mafintosh/gunzip-maybe.svg?style=flat)](http://travis-ci.org/mafintosh/gunzip-maybe)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

## 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.

``` 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

---
_Source: https://npm.io/package/gunzip-maybe · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
