我使用库https://www.npmjs.com/package/csvjson将CSV转换为JSON,我们可以使用特定的符号转换对象数组,但是我需要配置它来转换对象的动态数组长度,我非常需要要完成的功能
readFile('./test.csv', 'utf-8', (err, fileContent) => {
if (err) {
console.log(err); // Do something to handle the error or just throw it
throw new Error(err);
}
const jsonObj = csvjson.toSchemaObject(fileContent);
res.send(jsonObj)// to test res
});