1
const data_ = () => {
let array = []
fs.createReadStream('./files/treinamento.csv')
.pipe(csv())
.on('data', (data) => {
array.push(data)
})
.on('end', () => {
console.log(array)
})
}
Using console.log I get return with the values I want, but replacing the console with Return the function returns me an empty array. Someone could give me a solution ?