Sha256: 0c40eaa788a2f92dc61fc92bdda276f99f5b17c8424d37cf17783338ccba2386

Contents?: true

Size: 1.88 KB

Versions: 40

Compression:

Stored size: 1.88 KB

Contents

# minizlib

A fast zlib stream built on [minipass](http://npm.im/minipass) and
Node.js's zlib binding.

This module was created to serve the needs of
[node-tar](http://npm.im/tar) and
[minipass-fetch](http://npm.im/minipass-fetch).

Brotli is supported in versions of node with a Brotli binding.

## How does this differ from the streams in `require('zlib')`?

First, there are no convenience methods to compress or decompress a
buffer.  If you want those, use the built-in `zlib` module.  This is
only streams.  That being said, Minipass streams to make it fairly easy to
use as one-liners: `new zlib.Deflate().end(data).read()` will return the
deflate compressed result.

This module compresses and decompresses the data as fast as you feed
it in.  It is synchronous, and runs on the main process thread.  Zlib
and Brotli operations can be high CPU, but they're very fast, and doing it
this way means much less bookkeeping and artificial deferral.

Node's built in zlib streams are built on top of `stream.Transform`.
They do the maximally safe thing with respect to consistent
asynchrony, buffering, and backpressure.

See [Minipass](http://npm.im/minipass) for more on the differences between
Node.js core streams and Minipass streams, and the convenience methods
provided by that class.

## Classes

- Deflate
- Inflate
- Gzip
- Gunzip
- DeflateRaw
- InflateRaw
- Unzip
- BrotliCompress (Node v10 and higher)
- BrotliDecompress (Node v10 and higher)

## USAGE

```js
const zlib = require('minizlib')
const input = sourceOfCompressedData()
const decode = new zlib.BrotliDecompress()
const output = whereToWriteTheDecodedData()
input.pipe(decode).pipe(output)
```

## REPRODUCIBLE BUILDS

To create reproducible gzip compressed files across different operating
systems, set `portable: true` in the options.  This causes minizlib to set
the `OS` indicator in byte 9 of the extended gzip header to `0xFF` for
'unknown'.

Version data entries

40 entries across 39 versions & 5 rubygems

Version Path
immosquare-cleaner-0.1.52 node_modules/minizlib/README.md
immosquare-cleaner-0.1.51 node_modules/minizlib/README.md
immosquare-cleaner-0.1.50 node_modules/minizlib/README.md
immosquare-cleaner-0.1.49 node_modules/minizlib/README.md
immosquare-cleaner-0.1.48 node_modules/minizlib/README.md
immosquare-cleaner-0.1.47 node_modules/minizlib/README.md
immosquare-cleaner-0.1.46 node_modules/minizlib/README.md
immosquare-cleaner-0.1.45 node_modules/minizlib/README.md
immosquare-cleaner-0.1.44 node_modules/minizlib/README.md
immosquare-cleaner-0.1.43 node_modules/minizlib/README.md
immosquare-cleaner-0.1.42 node_modules/minizlib/README.md
immosquare-cleaner-0.1.41 node_modules/minizlib/README.md
immosquare-cleaner-0.1.40 node_modules/minizlib/README.md
immosquare-cleaner-0.1.39 node_modules/minizlib/README.md
immosquare-cleaner-0.1.38 node_modules/minizlib/README.md
immosquare-cleaner-0.1.32 node_modules/minizlib/README.md
immosquare-cleaner-0.1.31 node_modules/minizlib/README.md
immosquare-cleaner-0.1.30 node_modules/minizlib/README.md
immosquare-cleaner-0.1.29 node_modules/minizlib/README.md
immosquare-cleaner-0.1.28 node_modules/minizlib/README.md