javascript - Cannot find name 'XLSX' when adding test.ts file -
i have added xlsx.full.min.js file.
here code
var workbook = xlsx.read(data, { type: 'binary' }); var sheetname = workbook.sheetnames[0]; var exceldata = xlsx.utils.sheet_to_row_object_array(workbook.sheets[sheetname]);
you have install xlsx
module using npm install xlsx
have intialize xlsx
variable on top of code if(typeof require !== 'undefined') xlsx = require('xlsx');
. check library details: https://www.npmjs.com/package/xlsx
Comments
Post a Comment