All examples
basics
Parse a file in Node.js
One line to turn any spreadsheet into JSON.
Pass a file path to tabularjs and get a structured JSON document with every worksheet, its name, and its rows.
js
import tabularjs from 'tabularjs';
const result = await tabularjs('./data/sales.xlsx');
for (const sheet of result.worksheets) {
console.log(sheet.name, '->', sheet.data.length, 'rows');
}Live Preview
Sample output for a file with employee data.
stdout
{
"worksheets": [
{
"name": "Sheet1",
"data": [
["Name", "Department", "Salary", "Start Date"],
["Alice Johnson", "Engineering", 95000, "2021-03-15"],
["Bob Smith", "Marketing", 72000, "2022-01-10"],
["Carol Williams", "Engineering", 88000, "2020-07-22"],
["David Brown", "Design", 68000, "2023-02-08"],
["Eve Davis", "Engineering", 102000, "2019-11-30"]
]
}
]
}
