Node.js Streams

Making an object that speaks the node.js streams interface is surprisingly difficult.

There’s a fair number more interfaces than meet the eye:

You have the interplay of stream.readable and stream.resume()

You have the fact that streams speak in both Buffers and Strings.

sys.pump doesn’t relay errors, so you have to attach handlers to the right objects – I’m not sure if that one’s a problem yet or not.