JavaScript Answers

How to read Excel file using Node.js?

Spread the love

To read Excel file using Node.js, we call the ExcelJS readFile method.

We install it by running

npm i exceljs

And we write

const ExcelJS = require("exceljs/dist/es5");
const workbook = new Excel.Workbook();
await workbook.xlsx.readFile(filename);

to create a workbook with the Workbook constructor.

Then we call readFile to read the filename file into the workbook.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published.