I have a csv file I want to use in node.js/express. How can I convert the file to a variable of type array/json/string. I've tried:
fs.readFile('Resource.csv', function(err, data) {
console.log(data)}
And also tried a number of other things I could find in SO but none work for me. The data is of multiple rows if it matters.
const csvtojson=require('csvtojson')then you should use csvtojson(...).fromFile(...).then