I am trying to write incoming data to a csv file. I tried to use http://csv.adaltas.com/generate/examples/
npm install csv
But I don't get the documentation. I just want to save some data into a csv file. But even the examples are not working. E.g. the example in the link above (Using the stream API) throws the following error message:
TypeError: Cannot read property 'eql' of undefined
(First I had to change the require path, after installing the csv full package I had to require it with:
var generate = require('csv/node_modules/csv-generate');
Obviously this guy uses the same node module: https://masteringmean.com/lessons/18-Writing-to-a-CSV-file-in-Nodejs
But I can't even get his code to work. I think it was made with an older (and better documented?!) version of the csv node module.
Can anyone help me? Maybe with some code, explaining the same basic things like the one seen in the link of masteringmean.com but for the newest version?
Thanks for any hints.
Cheers