make csv valid lines
I can't probably call this a streamming CSV writter, due to the lack of features, but it's enough to have the functionality I needed ATM. I'll probably add more features as needed, feel free to do it as well with a pull request ;)
npm install --save csvify
It's a transform stream that receives arrays and pipes CSV lines.
var CSVify = require'csvify';var csvStream = ','; // use ',' as a delimitercsvStreamwriteHead'name' 'age' 'address'; // write a headercsvStreamwriteHead'name' 'age' 'address'; // has the same behaviour as abovevar header = csvStreamread;console.logheader; // name,age,address\r\ncsvStreamwrite'JJ' 23 'Rua da Prata nº80, Lisboa';var line = csvStreamread;console.logline; // "JJ",23,"Rua da Prata nº80, Lisboa"\r\n
For a more complete usage example, check out the JSONStream test.