Typed-xlsx
Getting Started

Installation

Install typed-xlsx with npm, pnpm, yarn, or bun.

Install the package with your package manager of choice:

pnpm add @chronicstone/typed-xlsx

The main surface is now:

  • createExcelSchema() to describe columns
  • createWorkbook() for buffered exports
  • createWorkbookStream() for commit-based large exports
import { 
createExcelSchema
,
createWorkbook
,
createWorkbookStream
} from "@chronicstone/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
({
rows
: [{
firstName
: "Ada",
email
: "ada@example.com" }],
schema
,
}); const
streamWorkbook
=
createWorkbookStream
({
memoryProfile
: "low-memory",
});

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 send the XLSX to a file, a Node writable, or another streaming destination.

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