High-performance XLSX read/write for JavaScript & TypeScript, powered by Rust + WASM.
Full cell styling, data validation, conditional formatting, frozen panes, hyperlinks, comments, sheet protection, and more — features that SheetJS locks behind a paid Pro license — all free and open source.
import { initWasm, Workbook } from 'modern-xlsx'; await initWasm(); const wb = new Workbook(); const ws = wb.addSheet('Sheet1'); ws.cell('A1').value = 'Hello'; ws.cell('B1').value = 42; const bold = wb.createStyle().font({ bold: true }).build(wb.styles); ws.cell('A1').styleIndex = bold; await wb.toFile('output.xlsx');
100,000-row workbook, Node.js, single thread:
| Operation | modern-xlsx | SheetJS CE | |
|---|---|---|---|
| Read | 1,155 ms | 4,927 ms | 4.3x faster |
| Write | 5,048 ms | 5,048 ms | 1.0x |
| sheetToJson (10K) | 54 ms | 103 ms | 1.9x faster |
~29 KB JS + ~1.6 MB WASM. Zero runtime dependencies.
npm install modern-xlsx
Full API documentation: packages/modern-xlsx/README.md
crates/
modern-xlsx-core/ Rust core — OOXML parsing, XML generation, ZIP I/O
modern-xlsx-wasm/ WASM bridge — wasm-bindgen exports
packages/
modern-xlsx/ npm package — TypeScript API, tests, benchmarks
TypeScript API Workbook / Worksheet / Cell
│ JSON
WASM boundary wasm-bindgen bridge
│
Rust core OOXML parser & writer (quick-xml + zip)
Data crosses the WASM boundary as JSON strings for maximum throughput. The Rust core handles ZIP compression, SAX-style XML parsing, shared string table construction, and style resolution.
# Rust tests (424 tests) cargo test -p modern-xlsx-core # WASM build cd crates/modern-xlsx-wasm && wasm-pack build --target web --release \ --out-dir ../../packages/modern-xlsx/wasm --no-opt # TypeScript build + tests (1287 tests) pnpm -C packages/modern-xlsx build pnpm -C packages/modern-xlsx test # Lint cargo clippy -p modern-xlsx-core -- -D warnings pnpm -C packages/modern-xlsx lint
Toolchain: Rust 1.95.0 (Edition 2024) / TypeScript 6.0 / pnpm 11 / Biome 2.4