Skip to main content

simple-excel

Streaming xlsx that opens cleanly everywhere

Flat memory

Rows are pushed to a sink as they arrive and pulled through an async iterator on the way back. There is no in-memory worksheet, no whole-sheet XML string and no unbounded shared-string table.

No dependencies

The zip container, the XML tokenizer and the SpreadsheetML layer are all in the package, and compression is the platform's own CompressionStream. Nothing to audit but this.

Checked against Excel

Built against a committed corpus of real files and an oracle that opens every written file in Excel, LibreOffice, openpyxl, calamine and the Open XML SDK validator.

import { collectToBlob, createWorkbookWriter } from '@jetstreamapp/simple-excel';

const sink = collectToBlob();
const workbook = createWorkbookWriter(sink);
const sheet = workbook.addSheet('Accounts', { header: ['Id', 'Name'], freeze: { rows: 1 } });

for await (const record of records) {
await sheet.writeRow([record.Id, record.Name]);
}

await sheet.close();
await workbook.close();
const blob = await sink.result();