I need help, in typescript I am trying to read a cdv file in the same folder but I have an enoent error
import csv from 'csv-parser'
import fs from 'fs'
let results = new Array();
function LoadCSV(file: fs.PathLike){
fs.createReadStream(file)
.pipe(csv())
.on('data', (data) => results.push(data))
.on('end', () => {
console.log(results);
});
return results;
}
console.log(LoadCSV('./data.csv'));