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

Await async promisify - catch error.

Open Lassejoe opened this issue 5 years ago • 0 comments

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?

Lassejoe avatar Aug 31 '20 12:08 Lassejoe