return undefined
alicera opened this issue · comments
alicera commented
https://github.com/Keyang/node-csvtojson#from-csv-file-to-json-array
function csv2json(filename) {
// convert users.csv file to JSON array
CSVToJSON().fromFile(filename)
.then(users => {
// users is a JSON array
// log the JSON array
//console.log(users);
return users;
}).catch(err => {
// log error if any
console.log(err);
});
}
It will undefined.
My subject is using the function to get json result and let it return.