Bytes go in, but they don\textquotesingle{}t come out (when muted).

This is a basic pass-\/through stream, but when muted, the bytes are silently dropped, rather than being passed through.\hypertarget{md_sfcode_node_modules_mute_stream_README_autotoc_md17879}{}\doxysection{Usage}\label{md_sfcode_node_modules_mute_stream_README_autotoc_md17879}

\begin{DoxyCode}{0}
\DoxyCodeLine{var MuteStream = require('mute-\/stream')}
\DoxyCodeLine{}
\DoxyCodeLine{var ms = new MuteStream(options)}
\DoxyCodeLine{}
\DoxyCodeLine{ms.pipe(process.stdout)}
\DoxyCodeLine{ms.write('foo') // writes 'foo' to stdout}
\DoxyCodeLine{ms.mute()}
\DoxyCodeLine{ms.write('bar') // does not write 'bar'}
\DoxyCodeLine{ms.unmute()}
\DoxyCodeLine{ms.write('baz') // writes 'baz' to stdout}
\DoxyCodeLine{}
\DoxyCodeLine{// can also be used to mute incoming data}
\DoxyCodeLine{var ms = new MuteStream}
\DoxyCodeLine{input.pipe(ms)}
\DoxyCodeLine{}
\DoxyCodeLine{ms.on('data', function (c) \{}
\DoxyCodeLine{  console.log('data: ' + c)}
\DoxyCodeLine{\})}
\DoxyCodeLine{}
\DoxyCodeLine{input.emit('data', 'foo') // logs 'foo'}
\DoxyCodeLine{ms.mute()}
\DoxyCodeLine{input.emit('data', 'bar') // does not log 'bar'}
\DoxyCodeLine{ms.unmute()}
\DoxyCodeLine{input.emit('data', 'baz') // logs 'baz' }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_mute_stream_README_autotoc_md17880}{}\doxysection{Options}\label{md_sfcode_node_modules_mute_stream_README_autotoc_md17880}
All options are optional.


\begin{DoxyItemize}
\item {\ttfamily replace} Set to a string to replace each character with the specified string when muted. (So you can show {\ttfamily $\ast$$\ast$$\ast$$\ast$} instead of the password, for example.)
\item {\ttfamily prompt} If you are using a replacement char, and also using a prompt with a readline stream (as for a {\ttfamily Password\+: $\ast$$\ast$$\ast$$\ast$$\ast$} input), then specify what the prompt is so that backspace will work properly. Otherwise, pressing backspace will overwrite the prompt with the replacement character, which is weird.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_mute_stream_README_autotoc_md17881}{}\doxysection{ms.\+mute()}\label{md_sfcode_node_modules_mute_stream_README_autotoc_md17881}
Set {\ttfamily muted} to {\ttfamily true}. Turns {\ttfamily .write()} into a no-\/op.\hypertarget{md_sfcode_node_modules_mute_stream_README_autotoc_md17882}{}\doxysection{ms.\+unmute()}\label{md_sfcode_node_modules_mute_stream_README_autotoc_md17882}
Set {\ttfamily muted} to {\ttfamily false}\hypertarget{md_sfcode_node_modules_mute_stream_README_autotoc_md17883}{}\doxysection{ms.\+is\+TTY}\label{md_sfcode_node_modules_mute_stream_README_autotoc_md17883}
True if the pipe destination is a TTY, or if the incoming pipe source is a TTY.\hypertarget{md_sfcode_node_modules_mute_stream_README_autotoc_md17884}{}\doxysection{Other stream methods...}\label{md_sfcode_node_modules_mute_stream_README_autotoc_md17884}
The other standard readable and writable stream methods are all available. The Mute\+Stream object acts as a facade to its pipe source and destination. 