【发布时间】:2021-06-13 19:41:50
【问题描述】:
我正在尝试使用此节点模块上传和读取 excel 文件:read-excel-file 并根据 Browser 下的说明,我需要将此代码放入我的 .js 文件中:
import readXlsxFile from 'read-excel-file'
const input = document.getElementById('input')
input.addEventListener('change', () => {
readXlsxFile(input.files[0]).then((rows) => {
// `rows` is an array of rows
// each row being an array of cells.
})
})
但是浏览器不知道import readXlsxFile from 'read-excel-file' 是什么。需要注意的是我使用http-server在http://localhost:8080/查看我的项目
【问题讨论】:
标签: javascript node.js npm node-modules httpserver