我正在尝试类似下面的内容,但这不起作用
const parser = parse(req.file, {
headers: true
})
// Use the readable stream api
parser.on('data', function(csvrow) {
console.log(csvrow);
})
这对我有用
parse(sampleFile, {columns: true}, function(err, data){
console.log(JSON.stringify(data,null,2));
});