binary-csv
binary-csv copied to clipboard
data event emits line *and* index of that line
At the moment AFAICT (!) I can't get the index of the current line. I'd love something like:
.on('data', function(line, index) {... }
This is useful in a whole bunch of situations. Would it be possible to add - e.g. i'm implementing a head operator for a csv in https://github.com/okfn/datapipes
you can implement another stream that does fancy stuff and then pipe binary-csv into that, e.g.
https://npmjs.org/package/head-stream
or you could write a simple stream that gives you objects with the index and the buffer of everything written into it