Streaming Export API
Why Streaming?
Usage in the Browser
import { createWorkbook, createExcelFileStream } from 'excel-builder-vanilla';
const workbook = createWorkbook();
const worksheet = workbook.createWorksheet({ name: 'Demo' });
worksheet.setData([
['Artist', 'Album', 'Price'],
['Buckethead', 'Albino Slug', 8.99],
// ... more rows
]);
workbook.addWorksheet(worksheet);
const stream = createExcelFileStream(workbook, { chunkSize: 1000 });
const chunks: Uint8Array[] = [];
for await (const chunk of stream as AsyncIterable<Uint8Array>) {
chunks.push(chunk);
// Optionally update progress bar here
}
const blob = new Blob(chunks, { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
const url = URL.createObjectURL(blob);
// Download with anchor tagUsage in NodeJS
Supported Features
See Also
Last updated