excel-to-rows
Parses a spreadsheet and returns the rows as objects.
Examples
Read from a file
const excelToRows = ; // Read as .xlsx fileexcelToRows; // Read as .csv fileexcelToRows; // Read as automatically determined file typeexcelToRows;
Read from a stream
const excelToRows = ;const fs = ; // Read as .xlsx fileexcelToRow; // Read as .csv fileexcelToRow;
Example
data.xlsx
ID | First Name | Last Name | Job |
---|---|---|---|
0 | Albert | Einstein | Theoretical Physicist |
1 | Jeff | Delaney | JS Developer |
2 | Jeff | Bezos | CEO of Amazon |
index.js
const excelToRows = ; { console;}
Output:
[
{
ID: 0,
'First Name': 'Albert',
'Last Name': 'Einstein',
Job: 'Theoretical Physicist'
},
{
ID: 1,
'First Name': 'Jeff',
'Last Name': 'Delaney',
Job: 'JS Developer'
},
{
ID: 2,
'First Name': 'Jeff',
'Last Name': 'Bezos',
Job: 'CEO of Amazon'
}
]