3 Bytes go in, but they don't come out (when muted).
5 This is a basic pass-through stream, but when muted, the bytes are
6 silently dropped, rather than being passed through.
11 var MuteStream = require('mute-stream')
13 var ms = new MuteStream(options)
15 ms.pipe(process.stdout)
16 ms.write('foo') // writes 'foo' to stdout
18 ms.write('bar') // does not write 'bar'
20 ms.write('baz') // writes 'baz' to stdout
22 // can also be used to mute incoming data
23 var ms = new MuteStream
26 ms.on('data', function (c) {
27 console.log('data: ' + c)
30 input.emit('data', 'foo') // logs 'foo'
32 input.emit('data', 'bar') // does not log 'bar'
34 input.emit('data', 'baz') // logs 'baz'
39 All options are optional.
41 * `replace` Set to a string to replace each character with the
42 specified string when muted. (So you can show `****` instead of the
43 password, for example.)
45 * `prompt` If you are using a replacement char, and also using a
46 prompt with a readline stream (as for a `Password: *****` input),
47 then specify what the prompt is so that backspace will work
48 properly. Otherwise, pressing backspace will overwrite the prompt
49 with the replacement character, which is weird.
53 Set `muted` to `true`. Turns `.write()` into a no-op.
57 Set `muted` to `false`
61 True if the pipe destination is a TTY, or if the incoming pipe source is
64 ## Other stream methods...
66 The other standard readable and writable stream methods are all
67 available. The MuteStream object acts as a facade to its pipe source