Open Minori-Akizuki opened 4 years ago
@Minori-Akizuki What you need is to execute the csvReader function for each file. something like this:
const csvReader = require('csvtojson') // and not const csvReader = require('csvtojson')()
module.exports = function() {
return {
readcsv: async function(path) {
const json = await csvReader().fromFile(path);
return json;
},
};
};
when I use
fromFile
to read CSV file. In the application some time happened read same file because its interactive program.its simple code.
I had this error
maybe, I wrong to use promise. if it is true, please close this issue.
Thank you.