A fast zlib stream built on \href{http://npm.im/minipass}{\texttt{ minipass}} and Node.\+js\textquotesingle{}s zlib binding.

This module was created to serve the needs of \href{http://npm.im/tar}{\texttt{ node-\/tar}} and \href{http://npm.im/minipass-fetch}{\texttt{ minipass-\/fetch}}.

Brotli is supported in versions of node with a Brotli binding.\hypertarget{md_sfcode_node_modules_pacote_node_modules_minizlib_README_autotoc_md19883}{}\doxysection{How does this differ from the streams in ‘require(\textquotesingle{}zlib’)\`{}?}\label{md_sfcode_node_modules_pacote_node_modules_minizlib_README_autotoc_md19883}
First, there are no convenience methods to compress or decompress a buffer. If you want those, use the built-\/in {\ttfamily zlib} module. This is only streams. That being said, Minipass streams to make it fairly easy to use as one-\/liners\+: {\ttfamily 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\textquotesingle{}re very fast, and doing it this way means much less bookkeeping and artificial deferral.

Node\textquotesingle{}s built in zlib streams are built on top of {\ttfamily stream.\+Transform}. They do the maximally safe thing with respect to consistent asynchrony, buffering, and backpressure.

See \href{http://npm.im/minipass}{\texttt{ Minipass}} for more on the differences between Node.\+js core streams and Minipass streams, and the convenience methods provided by that class.\hypertarget{md_sfcode_node_modules_pacote_node_modules_minizlib_README_autotoc_md19884}{}\doxysection{Classes}\label{md_sfcode_node_modules_pacote_node_modules_minizlib_README_autotoc_md19884}

\begin{DoxyItemize}
\item Deflate
\item Inflate
\item Gzip
\item Gunzip
\item Deflate\+Raw
\item Inflate\+Raw
\item Unzip
\item Brotli\+Compress (Node v10 and higher)
\item Brotli\+Decompress (Node v10 and higher)
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_pacote_node_modules_minizlib_README_autotoc_md19885}{}\doxysection{USAGE}\label{md_sfcode_node_modules_pacote_node_modules_minizlib_README_autotoc_md19885}

\begin{DoxyCode}{0}
\DoxyCodeLine{const zlib = require('minizlib')}
\DoxyCodeLine{const input = sourceOfCompressedData()}
\DoxyCodeLine{const decode = new zlib.BrotliDecompress()}
\DoxyCodeLine{const output = whereToWriteTheDecodedData()}
\DoxyCodeLine{input.pipe(decode).pipe(output) }

\end{DoxyCode}
 