top of page
Search
  • Writer's picturealeksvp

How to process a spreadsheet using Node.js and SheetJS js-xlsx module

Using:

  • Node.js: the runtime environment;

  • SheetJS js-xlsx: read and parse xlsx files.

We used FS to read a local file and get its buffer.


We defined the struct expected for the spread sheet in the file spreadsheet.js. There are the mandatory columns, worksheet name and methods to validade cell values.


With the buffer and the struct in hands, the app use XLS to read the sheet. Then, we validate the header and the lines. Finally, we iterate through the cells just printing their values in the console.

Pretty simple, uh?



81 views0 comments

Comments


Post: Blog2_Post
bottom of page