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

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -