How To Read Excel File With NodeJS part - (1)

less than 1 minute read

Author: Doe Hoon LEE

Long time no see!
Today, we are going to learn how to read an excel file with an npm called

read-excel-file

To install, type the following in terminal

npm install read-excel-file --save

This is the sample excel data that we are going to use!

Sample Excel Data

We first need to import the module
const readXlsxFile = require('read-excel-file/node');

then

To print the data,
readXlsxFile(pathToExcelFile).then((rows) => {
  console.log(rows);
})
Then we execute the file we created
node excelReader.js

Sample Excel Data Read

Please take some time and see how the contents of excel file are converted in a form of array!

Next time, we are going to learn how to format better with these!

See you again!

Take care!

Leave a comment