You've just bound to the wrong stream. 'data'
events will occur on readable streams, like the stream
created by ytdl
.
stream.on('data', function (chunk) {
// ...
});
And 'close'
events will occur on both streams if you're using Node 0.8 or older. While 0.10 changed the event for writable streams to 'finish'
.