decompress-maybe
Version:
Transform stream that decompress its input if it's compressed, and echoes it if not
27 lines (21 loc) • 1.12 kB
Markdown
# decompress-maybe
Transform stream that decompress its input if it's compressed, and echoes it if
not
This module accept a stream compressed using `gunzip` or `bzip2` formats and
output the decompressed stream. In case the input stream was already
decompressed it returns it as-is. More compression formats could be added in the
future, pull-requests are welcome :-)
This is a collaboration project between Mathias Buss
"[mafintosh](https://mafinto.sh)" and Jesús Leganés-Combarro
"[piranna](https://piranna.github.io)".
## Supported algorithms
- [ ] `brotli`. **Help wanted**, see
<https://github.com/piranna/decompress-maybe/issues/2#issuecomment-1575136739>
- [x] `bzip2`, using [bzip2-maybe](https://www.npmjs.com/package/bzip2-maybe)
- [x] `unzip`, not the
[Node.js native](https://nodejs.org/api/zlib.html#class-zlibunzip) one,
but provided by [gunzip-maybe](https://github.com/mafintosh/gunzip-maybe)
instead. See <https://github.com/mafintosh/gunzip-maybe/issues/10>
- [x] `gunzip`
- [x] `inflate`
- [x] `zstd`, using [simple-zstd](https://www.npmjs.com/package/simple-zstd)