node-csvtojson
node-csvtojson copied to clipboard
api to get only headers
I'm looking into some shortcut to get only headers as an array, so that i can validate them easily. I'm eagerly looking for position validation so includeHeaders as a regexp is not enough.
Any idea? preferably with using the async/await api, but can fallback to events if necessary.
Have you tried this one from the README ?
const csv=require('csvtojson')
csv()
.on('header',(header)=>{
//header=> [header1, header2, header3]
})