Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const csv = require('@fast-csv/format');
const rows = [
['a', 'b'],
['a1', 'b1'],
['a2', 'b2'],
];
csv.writeToStream(process.stdout, rows);
// Output:
// a,b
// a1,b1
// a2,b2
return new Promise((res, rej) => {
writeToStream(stream, rows, options)
.on('error', (err: Error) => rej(err))
.on('finish', () => res());
});
}
return new Promise((res, rej) => {
csv.writeToStream(filestream, rows, options)
.on('error', err => rej(err))
.on('finish', () => res());
});
}