📊

driver-excel

Official
driver

Parse and generate Excel files with ease. Support for XLSX, XLS, and CSV formats with advanced formatting options.

ostack add driver-excel

Documentation

Excel Driver for ObjectStack

Read, write, and manipulate Excel files with a simple, intuitive API.

Features

  • ✅ Read/Write XLSX, XLS, CSV
  • ✅ Cell formatting and styling
  • ✅ Formula support
  • ✅ Charts and images
  • ✅ Large file streaming

Installation

ostack add driver-excel

Quick Start

import { ExcelDriver } from '@objectstack/driver-excel';

const excel = new ExcelDriver();

// Read Excel file
const workbook = await excel.read('data.xlsx');
const sheet = workbook.getSheet('Sheet1');
const data = sheet.getData();

// Write Excel file
const newWorkbook = excel.createWorkbook();
const newSheet = newWorkbook.addSheet('Sales');
newSheet.setData([
  ['Product', 'Price', 'Quantity'],
  ['Widget', 29.99, 100],
  ['Gadget', 49.99, 50]
]);

await excel.write(newWorkbook, 'output.xlsx');

Advanced Features

Formatting

sheet.getCell('A1').style = {
  font: { bold: true, size: 14 },
  fill: { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FFFF0000' } }
};

Formulas

sheet.getCell('D2').value = { formula: '=B2*C2' };

License

MIT © ObjectStack Team