{Readable, Writable} = require('stream') class Sink extends Writable _write: (data, enc, next) -> console.log(data.toString()) next() # a simple source stream source = new Readable source.push 'the quick brown fox ' source.push 'jumps over the lazy dog.\n' source.push null sink = new Sink source.pipe(sink) # the quick brown fox # jumps over the lazy dog. ### Same example as above except that the source stream passes strings (instead of buffers) and the sink stream doesn't decode the strings to buffers before writing. ### class Sink extends Writable constructor: -> super(decodeStrings: false) # don't decode strings _write: (data, enc, next) -> console.log(data) next() # a simple source stream source = new Readable(encoding: 'utf8') # buffers will be decoded to strings source.push 'the quick brown fox ' source.push 'jumps over the lazy dog.\n' source.push null sink = new Sink source.pipe(sink) # the quick brown fox # jumps over the lazy dog.