Installation
Install the package with your package manager of choice:
pnpm add typed-xlsx
npm install typed-xlsx
yarn add typed-xlsx
bun add typed-xlsx
The main surface is now:
createExcelSchema()to describe columnscreateWorkbook()for buffered exportscreateWorkbookStream()for commit-based large exports
createExcelSchema() defaults to report mode. If you need native Excel table output, see Schema Modes and Table Mode.
import { createExcelSchema, createWorkbook, createWorkbookStream } from "typed-xlsx";
type User = {
email: string;
firstName: string;
};
const schema = createExcelSchema<User>()
.column("firstName", {
header: "First name",
accessor: "firstName",
})
.column("email", {
header: "Email",
accessor: "email",
})
.build();
const workbook = createWorkbook();
workbook.sheet("Users").table("users", {
rows: [{ firstName: "Ada", email: "ada@example.com" }],
schema,
});
const streamWorkbook = createWorkbookStream();
Use the buffered builder when the dataset is reasonably sized and you want full workbook composition. Use the stream builder when you want to commit batches and finalize to a file or stream-friendly output.
Requirements
typed-xlsx ships as ESM-only. It works in Node.js, Bun, Deno, Cloudflare Workers, and any runtime with standard ReadableStream / WritableStream support. No native addons, no peer dependencies.
Next steps
- Build a complete report end-to-end -- Quick Start
- Understand the two schema modes -- Schema Modes
- See how
typed-xlsxcompares tohucre, SheetJS, and ExcelJS -- Library Comparison
Introduction
typed-xlsx is a TypeScript-first Excel report builder with a type-safe schema DSL, formula columns, streaming exports, and a custom OOXML engine — no SheetJS, no wrappers.
Quick Start
Build your first XLSX report — buffered or streaming — with typed schemas, formula columns, and summary rows.