source: trip-planner-front/node_modules/minizlib/README.md@ b738035

Last change on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.9 KB
Line 
1# minizlib
2
3A fast zlib stream built on [minipass](http://npm.im/minipass) and
4Node.js's zlib binding.
5
6This module was created to serve the needs of
7[node-tar](http://npm.im/tar) and
8[minipass-fetch](http://npm.im/minipass-fetch).
9
10Brotli is supported in versions of node with a Brotli binding.
11
12## How does this differ from the streams in `require('zlib')`?
13
14First, there are no convenience methods to compress or decompress a
15buffer. If you want those, use the built-in `zlib` module. This is
16only streams. That being said, Minipass streams to make it fairly easy to
17use as one-liners: `new zlib.Deflate().end(data).read()` will return the
18deflate compressed result.
19
20This module compresses and decompresses the data as fast as you feed
21it in. It is synchronous, and runs on the main process thread. Zlib
22and Brotli operations can be high CPU, but they're very fast, and doing it
23this way means much less bookkeeping and artificial deferral.
24
25Node's built in zlib streams are built on top of `stream.Transform`.
26They do the maximally safe thing with respect to consistent
27asynchrony, buffering, and backpressure.
28
29See [Minipass](http://npm.im/minipass) for more on the differences between
30Node.js core streams and Minipass streams, and the convenience methods
31provided by that class.
32
33## Classes
34
35- Deflate
36- Inflate
37- Gzip
38- Gunzip
39- DeflateRaw
40- InflateRaw
41- Unzip
42- BrotliCompress (Node v10 and higher)
43- BrotliDecompress (Node v10 and higher)
44
45## USAGE
46
47```js
48const zlib = require('minizlib')
49const input = sourceOfCompressedData()
50const decode = new zlib.BrotliDecompress()
51const output = whereToWriteTheDecodedData()
52input.pipe(decode).pipe(output)
53```
54
55## REPRODUCIBLE BUILDS
56
57To create reproducible gzip compressed files across different operating
58systems, set `portable: true` in the options. This causes minizlib to set
59the `OS` indicator in byte 9 of the extended gzip header to `0xFF` for
60'unknown'.
Note: See TracBrowser for help on using the repository browser.