0

I am trying to parse Excel content into JSON using the xlsx npm module, however it doesn't return any content.

Why don't I find anything inside workbook.Sheets?

Example:

var workbook = XLSX.readFile(req.body.content+'.xlsx');

var sheet_name_list = workbook.SheetNames;

var ws = workbook.Sheets[sheet_name_list[0]];

console.log(ws) //undefined
RobC
  • 22,977
  • 20
  • 73
  • 80

1 Answers1

0

You should recode line 3 like down below.

var ws = XLSX.utils.sheet_to_json(workbook.Sheets[sheet_name_list[0]]);