Combine an array of streams into a single duplex stream using \href{https://github.com/mafintosh/pump}{\texttt{ pump}} and \href{https://github.com/mafintosh/duplexify}{\texttt{ duplexify}}. If one of the streams closes/errors all streams in the pipeline will be destroyed.


\begin{DoxyCode}{0}
\DoxyCodeLine{npm install pumpify }

\end{DoxyCode}


\href{http://travis-ci.org/mafintosh/pumpify}{\texttt{ }}\hypertarget{md_sfcode_node_modules_pumpify_README_autotoc_md23551}{}\doxysection{Usage}\label{md_sfcode_node_modules_pumpify_README_autotoc_md23551}
Pass the streams you want to pipe together to pumpify {\ttfamily pipeline = pumpify(s1, s2, s3, ...)}. {\ttfamily pipeline} is a duplex stream that writes to the first streams and reads from the last one. Streams are piped together using \href{https://github.com/mafintosh/pump}{\texttt{ pump}} so if one of them closes all streams will be destroyed.


\begin{DoxyCode}{0}
\DoxyCodeLine{var pumpify = require('pumpify')}
\DoxyCodeLine{var tar = require('tar-\/fs')}
\DoxyCodeLine{var zlib = require('zlib')}
\DoxyCodeLine{var fs = require('fs')}
\DoxyCodeLine{}
\DoxyCodeLine{var untar = pumpify(zlib.createGunzip(), tar.extract('output-\/folder'))}
\DoxyCodeLine{// you can also pass an array instead}
\DoxyCodeLine{// var untar = pumpify([zlib.createGunzip(), tar.extract('output-\/folder')])}
\DoxyCodeLine{}
\DoxyCodeLine{fs.createReadStream('some-\/gzipped-\/tarball.tgz').pipe(untar) }

\end{DoxyCode}


If you are pumping object streams together use {\ttfamily pipeline = pumpify.\+obj(s1, s2, ...)}. Call {\ttfamily pipeline.\+destroy()} to destroy the pipeline (including the streams passed to pumpify).\hypertarget{md_sfcode_node_modules_pumpify_README_autotoc_md23552}{}\doxysubsection{Using $<$tt$>$set\+Pipeline(s1, s2, ...)$<$/tt$>$}\label{md_sfcode_node_modules_pumpify_README_autotoc_md23552}
Similar to \href{https://github.com/mafintosh/duplexify}{\texttt{ duplexify}} you can also define the pipeline asynchronously using {\ttfamily set\+Pipeline(s1, s2, ...)}


\begin{DoxyCode}{0}
\DoxyCodeLine{var untar = pumpify()}
\DoxyCodeLine{}
\DoxyCodeLine{setTimeout(function() \{}
\DoxyCodeLine{  // will start draining the input now}
\DoxyCodeLine{  untar.setPipeline(zlib.createGunzip(), tar.extract('output-\/folder'))}
\DoxyCodeLine{\}, 1000)}
\DoxyCodeLine{}
\DoxyCodeLine{fs.createReadStream('some-\/gzipped-\/tarball.tgz').pipe(untar) }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_pumpify_README_autotoc_md23553}{}\doxysection{License}\label{md_sfcode_node_modules_pumpify_README_autotoc_md23553}
MIT\hypertarget{md_sfcode_node_modules_pumpify_README_autotoc_md23554}{}\doxysection{Related}\label{md_sfcode_node_modules_pumpify_README_autotoc_md23554}
{\ttfamily pumpify} is part of the \href{https://github.com/maxogden/mississippi}{\texttt{ mississippi stream utility collection}} which includes more useful stream modules similar to this one. 