JavaScript – Reading Excel file using node.js! Solved!

This post will show you how can you access the data in your excel sheet(.xlsx) file from your node.js code.

Suppose this is our excel sheet:

excel sheet

Here we are using an existing npm package known as xlsx.

xlsx is a parser and writer for various spreadsheet formats.


With npm:

$ npm install xlsx
Usage in node.js
The above code will fetch you the first column values as JavaScript object in an array as shown below:
output: excel data as JavaScript object

Same code if you have multiple columns:

Multiple Columns



Hope it helps!

Subscribe for more!


7 thoughts on “JavaScript – Reading Excel file using node.js! Solved!

    1. Where can I find a concrete resources for node js? A documentation which states all the attribute, methods used and how xlsx, excel sheet are created, deleted and removed, would be more useful.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s