node-csvtojson
node-csvtojson copied to clipboard
Await async promisify - catch error.
Error:
reason: TypeError: (0 , _csvtojson2.default)(...).fromFile(...).catch is not a function
code:
import csvtojson from 'csvtojson'
json_obj = await csvtojson({options}).fromFile('{pathToFile}').catch((err) => console.error(err))
.catch tries to catch any and not onRejected?