nodejs读取excel

 

// import puppeteer from 'puppeteer'
// https://github.com/SheetJS/sheetjs
import reader from 'xlsx'
const file = reader.readFile('D:\\doc\\名单.xlsx', { cellDates: true, sheetRows:0, sheets: '展示'})

async function xls2json() {
  let data = []
  const temp = reader.utils.sheet_to_json(file.Sheets['展示'])
  data = temp
  return {data}
}

 

posted @ 2022-12-20 11:10  zyip  阅读(444)  评论(0)    收藏  举报