Github: https://github.com/vanloctech/bun-spreadsheet
NPM: https://www.npmjs.com/package/bun-spreadsheet
Why This Package
-
Built for Bun, not adapted from Node-first abstractions — The core file paths use
Bun.file(),Bun.write(),FileSink, and Bun-native streaming APIs directly. -
Works naturally with Bun-native file targets, including S3 — Read from and write to local paths,
Bun.file(...), and BunS3Fileobjects, including direct streaming exports to S3 destinations. -
Production export helpers for Bun backends — Supports progress callbacks,
AbortSignal, export diagnostics, streamingResponsehelpers, and S3 multipart tuning through Bun-native writer options. -
TypeScript-first spreadsheet model —
Workbook,Worksheet,Row,Cell, and style objects are explicit and practical to work with in Bun apps. - Focused on real report workflows — Styles, formulas, hyperlinks, data validation, conditional formatting, auto filters, freeze/split panes, and workbook metadata are supported where they matter for business exports.
- Multiple write strategies for different workloads — Use normal writes for simplicity, stream writes for lower memory pressure, and chunked disk-backed writes for large exports.
Benchmarks
Measured on Bun 1.3.10 / MacOS ARM with a single worksheet, compressed .xlsx, and 1,000,000 rows x 10 columns:
| Mode | Total time | Finalize time | Rows/sec | Peak RSS | Peak heapUsed | File size |
|---|---|---|---|---|---|---|
createExcelStream() |
13.1s |
8.9s |
76,363 |
110.6MB |
5.1MB |
54.33MB |
createChunkedExcelStream() |
11.9s |
8.5s |
84,029 |
120.9MB |
5.1MB |
54.33MB |
createExcelStream() now uses the same disk-backed low-memory path as the chunked writer for single-sheet exports, so the numbers are expected to be close. Re-run the large benchmark on your machine with:
Top comments (0)