@nap-sft/tablsx
v0.1.3
Published
A Node.js library for reading and writing Excel .xlsx files
Downloads
481
Readme
tablsx
tablsx is a lightweight ESM Node.js library for reading and writing Excel .xlsx files as predictable JavaScript data.
It is designed for data interchange, imports and exports, and programmatic workbook generation rather than full spreadsheet editing.
Installation
npm install @nap-sft/tablsxQuick start
import {
createCell,
createWorkbook,
createWorksheet,
readXlsx,
writeXlsx,
} from "@nap-sft/tablsx";
const workbook = createWorkbook([
createWorksheet("People", [
[createCell("name"), createCell("age")],
[createCell("Ada"), createCell(36)],
[createCell("Linus"), createCell(54)],
]),
]);
const bytes = writeXlsx(workbook);
const parsed = readXlsx(bytes);
console.log(parsed.sheets[0].rows[1][0].value);
// "Ada"Core capabilities
- Read
.xlsxworkbooks into a normalized JavaScript model - Write
.xlsxworkbooks from normalized workbook objects - Convert row objects to worksheets with
sheetFromRows - Convert worksheets back to row objects with
rowsFromSheet - Build workbooks fluently with
WorkbookBuilderandSheetBuilder - Work with strings, numbers, booleans, dates, formulas, empty cells, and numeric vectors
Documentation
Full documentation is available at silverstone-i.github.io/tablsx.
- Getting started
- Choosing an API
- Reading workbooks
- Writing workbooks
- Tabular workflows
- Builder API
- Reader API
- API reference
Development
npm test
npm run lint
npm run docs:dev