Excel使用Node JS进行JSON转换

我一直在试图把excel表格数据转换成json格式,而且我已经有了各种模块,比如“xls-to-json”,“xls-to-json-lc”,“node-excel-to-json”,到目前为止,我得到了空的答复。

我的示例代码如下所示:

var node_xj = require("xls-to-json"); node_xj({ input: req.file.path, // input xls output: "output.json", // output json sheet: "a" // specific sheetname }, function(err, result) { if(err) { console.error(err); } else { console.log("--------result----"); console.log(result); } }); 

我的Excel表包含非常简单的数据:

在这里输入图像描述

我在做什么错误,我正在得到文件和它的有效path。

得到的解决scheme,所有的图书馆认为第一行为标题,所以没有得到显示,它显示了当我添加第二行,每个模块都有自己的结构的输出/响应。 一些模块在输出中考虑excel标题,跳过第一行,less数包含第一行。