typed-xlsx
Getting Started

Installation

Install typed-xlsx and import the buffered and streaming builders.

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 columns
  • createWorkbook() for buffered exports
  • createWorkbookStream() 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

Copyright © 2026 Cyprien Thao. Released under the MIT License.