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
You have the fact that streams speak in both
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.