Skip to content

fxzero-dependency XLSX · v2.4.5

Real Excel files.None of the weight.

A modern XLSX reader and writer for TypeScript. Promise-based, tree-shakeable, and ready for the browser, Node, and the edge. Read, write, convert, and style workbooks without carrying a spreadsheet framework.

runtime dependencies
0
named ESM + CJS exports
async
test coverage
91%
output formats
4
report-builder.tsasync
import { arrayToSheet, createWorkbook,         styleRange, write } from "xlsx-format" const sheet = arrayToSheet(reportRows)styleRange(sheet, "A2:D2", headerStyle) const bytes = await write(book, {  type: "array", cellStyles: true })
Q2-report.xlsxOverview
A · Why switch

Most apps don’t need a spreadsheet framework.

If the job is XLSX, CSV, and polished report exports, xlsx-format keeps the useful parts in a focused bundle without requiring a spreadsheet framework.

Decision pointxlsx-formatSheetJSExcelJS
Read / write modelPromise APISynchronous public APIPromise-based selected APIs
Module formatESM + CJSESM + CJSCJS + browser build
Browser exportsread() + write()Separate bundleexceljs.browser.js
Styled reportsTyped style layerUtility modelWorkbook classes
B · Built for export work

One lean layer for the places spreadsheets actually show up.

  1. Styled browser reports, without ExcelJS

    Branded workbook downloads with fonts, fills, borders, number formats, merged titles, column widths, row heights, totals, and frozen panes.

    Styled workbooks
  2. Migrate SheetJS code, keep your data model

    Cell objects keep the familiar shape. Add await, switch to named imports, move from sheet_to_json to sheetToJson. Done.

    Migration guide
  3. Safer exports when data comes from users

    CSV formula-like fields are escaped by default. HTML export sanitizes unsafe link targets unless you explicitly opt out.

    Security guidance
  4. Convert spreadsheet data both ways

    Move between worksheets, JSON, arrays of arrays, CSV, TSV, and HTML tables with typed utilities built for modern runtimes.

    Getting started
C · Runs where your app runs

No Node-only core. No browser-only fork.

xlsx-format reads and writes in-memory sources: Uint8Array, ArrayBuffer, Node Buffer, base64, binary strings, CSV text, and HTML tables. Pair it with whatever I/O you already have.

Browser

Ships to the client

File inputs, fetch responses, and Blob downloads. No separate browser bundle.

Server

Wraps your own I/O

Async read and write around Node's fs, S3, or any byte source you already use.

Edge

Runs on the edge

No node:fs import and no dependency chain, so Workers and Deno Deploy just work.

D · Feature surface

Enough spreadsheet power for production reports, kept deliberately focused.

Workbook core

  • Multiple sheets
  • Defined names
  • Properties
  • Date systems

Cell data

  • Strings
  • Numbers
  • Dates
  • Booleans
  • Errors

Report styling

  • Fonts
  • Fills
  • Borders
  • Alignment
  • Number formats

Sheet structure

  • Merged cells
  • Column widths
  • Row heights
  • Frozen panes
  • Auto filters

Formulas & notes

  • Cell formulas
  • Array formulas
  • Shared formulas
  • Threaded comments

Export guards

  • CSV escaping
  • Link sanitizing
  • Error codes
  • ZIP & XML limits
Install the smaller layer

Start with async XLSX today.

Keep the workbook framework out of your bundle. Your users download less, your build stays fast.

npm install xlsx-format
Create your first workbook