I am struggling to find a way to write data to a CSV in Node.js.
There are several CSV plugins available however they only \'write\' to stdout.
For those who prefer fast-scv:
const { writeToPath } = require('@fast-csv/format');
const path = `${__dirname}/people.csv`;
const data = [{name: 'Stevie', id: 10}, {name: 'Ray', id: 20}];
const options = { headers: true, quoteColumns: true };
writeToPath(path, data, options)
.on('error', err => console.error(err))
.on('finish', () => console.log('Done writing.'));