npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@chronicstone/typed-xlsx

v1.0.4

Published

High-quality type-safe Excel reporting.

Downloads

7,839

Readme

typed-xlsx

npm version npm downloads bundle JSDocs License

Type-safe Excel reporting for TypeScript, with one clean schema API and two workbook modes:

  • createWorkbook() for polished buffered exports
  • createWorkbookStream() for large commit-based exports

What you get

  • Typed path accessors and accessor callbacks
  • Column transforms, defaults, styling, and formatting
  • Multi-row summaries with reducer-based APIs
  • Multi-sheet workbooks and multi-table buffered layouts
  • Freeze panes, RTL sheets, row expansion, merges, and auto sizing
  • Streamed XLSX generation for very large exports

Installation

pnpm add @chronicstone/typed-xlsx

Buffered example

import { createExcelSchema, createWorkbook } from "@chronicstone/typed-xlsx";

type Order = {
  id: string;
  customer: {
    name: string;
    email: string;
  };
  items: Array<{
    sku: string;
    quantity: number;
    unitPrice: number;
  }>;
};

const schema = createExcelSchema<Order>()
  .column("orderId", {
    header: "Order",
    accessor: "id",
  })
  .column("customerName", {
    header: "Customer",
    accessor: "customer.name",
  })
  .column("sku", {
    header: "SKU",
    accessor: (row) => row.items.map((item) => item.sku),
  })
  .column("lineTotal", {
    header: "Line Total",
    accessor: (row) => row.items.map((item) => item.quantity * item.unitPrice),
    style: {
      numFmt: "$#,##0.00",
    },
    summary: (summary) => [
      summary.label("TOTAL"),
      summary.cell({
        init: () => 0,
        step: (acc, row) =>
          acc + row.items.reduce((sum, item) => sum + item.quantity * item.unitPrice, 0),
        finalize: (acc) => acc,
        style: {
          numFmt: "$#,##0.00",
        },
      }),
    ],
  })
  .build();

const workbook = createWorkbook();

workbook
  .sheet("Orders", {
    freezePane: { rows: 1 },
  })
  .table({
    id: "orders",
    rows,
    schema,
  });

const bytes = workbook.toUint8Array();

Stream example

import { createExcelSchema, createWorkbookStream } from "@chronicstone/typed-xlsx";

const schema = createExcelSchema<{ amount: number; id: string }>()
  .column("id", {
    header: "ID",
    accessor: "id",
  })
  .column("amount", {
    header: "Amount",
    accessor: "amount",
    summary: (summary) => [
      summary.cell({
        init: () => 0,
        step: (acc, row) => acc + row.amount,
        finalize: (acc) => acc,
        style: { numFmt: "$#,##0.00" },
      }),
    ],
  })
  .build();

const workbook = createWorkbookStream({
  tempStorage: "file",
  memoryProfile: "low-memory",
});

const table = await workbook
  .sheet("Transactions", {
    freezePane: { rows: 1 },
  })
  .table({
    id: "transactions",
    schema,
  });

for await (const batch of getTransactionBatches()) {
  await table.commit({ rows: batch });
}

await workbook.writeToFile("./transactions.xlsx");

Notes on migration

This release promotes the new API as the main package surface.

  • key becomes accessor
  • summaries use reducer functions: init, step, finalize
  • selection uses include / exclude
  • styles use the library's own normalized CellStyle
  • stream workbooks support memoryProfile / strings to tune memory usage and file size

License

MIT License © 2023-PRESENT Cyprien THAO