wdavidw/node-csv-parser — pull request #25 by DamonOehlman (2012-03-31 03:01:12+00:00)
Title: Inherit from Stream rather than EventEmitter

Thanks for your efforts with node-csv-parser, it's definitely the goto CSV parser for node IMO. One thing I have been experimenting with lately is passing objects around using Streams in addition to raw strings and buffers. It tends to work really well, and I don't think it's breaking any golden rules as stream based composition is more of a pattern than anything else.

I would like to propose that the main class in node-csv-parser inherits it's prototype from Stream rather than EventEmitter so it gains access to the very useful pipe method.

An example of where I think this is useful is demonstrated in a library I recently started working on called filterstream. [This test](https://github.com/DamonOehlman/filterstream/blob/master/test/filtered.js) demonstrates how the modified version of node-csv-parser allows piping through the filterstream to provide a subset of results.

I've run the test suite after making the change and everything still works as expected (which isn't too surprising) and I've added an additional (albeit simple test) for checking that piping works.

Cheers,
Damon.