node-csvtojson icon indicating copy to clipboard operation
node-csvtojson copied to clipboard

api to get only headers

Open y-nk opened this issue 2 years ago • 1 comments

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.

y-nk avatar Dec 26 '23 05:12 y-nk

Have you tried this one from the README ?

const csv=require('csvtojson')
csv()
.on('header',(header)=>{
	//header=> [header1, header2, header3]
})

mebibou avatar Aug 27 '24 09:08 mebibou