Iterate all the data in a stream


\begin{DoxyCode}{0}
\DoxyCodeLine{npm install stream-\/each }

\end{DoxyCode}


\href{http://travis-ci.org/mafintosh/stream-each}{\texttt{ }}\hypertarget{md_sfcode_node_modules_stream_each_README_autotoc_md28914}{}\doxysection{Usage}\label{md_sfcode_node_modules_stream_each_README_autotoc_md28914}

\begin{DoxyCode}{0}
\DoxyCodeLine{var each = require('stream-\/each')}
\DoxyCodeLine{}
\DoxyCodeLine{each(stream, function (data, next) \{}
\DoxyCodeLine{  console.log('data from stream', data)}
\DoxyCodeLine{  // when ready to consume next chunk}
\DoxyCodeLine{  next()}
\DoxyCodeLine{\}, function (err) \{}
\DoxyCodeLine{  console.log('no more data')}
\DoxyCodeLine{\}) }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_stream_each_README_autotoc_md28915}{}\doxysection{API}\label{md_sfcode_node_modules_stream_each_README_autotoc_md28915}
\hypertarget{md_sfcode_node_modules_stream_each_README_autotoc_md28916}{}\doxysubsubsection{$<$tt$>$each(stream, iterator, cb)$<$/tt$>$}\label{md_sfcode_node_modules_stream_each_README_autotoc_md28916}
Iterate the data in the stream by calling the iterator function with {\ttfamily (data, next)} where data is a data chunk and next is a callback. Call next when you are ready to consume the next chunk. Optionally you can call next with an error to destroy the stream

When the stream ends/errors the callback is called if provided\hypertarget{md_sfcode_node_modules_stream_each_README_autotoc_md28917}{}\doxysection{License}\label{md_sfcode_node_modules_stream_each_README_autotoc_md28917}
MIT\hypertarget{md_sfcode_node_modules_stream_each_README_autotoc_md28918}{}\doxysection{Related}\label{md_sfcode_node_modules_stream_each_README_autotoc_md28918}
{\ttfamily stream-\/each} 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. 