xldx
JS Excel File Builder

Create Excel files with advanced styling, theming, and pattern-based formatting. Zero dependencies, works in browsers and in bun, node, and deno.

bun add xldx

The Fastest Lightest Excel File Generator

xldx delivers exceptional performance for Excel file generation with zero runtime dependencies. Perfect for generating reports, data exports, and spreadsheets in both browsers and node, bun, or deno.

0
Dependencies
Lightweight and fast
<17KB
Bundle Size
Minified and tree-shakeable
100%
Tree-Shakeable
Only import what you use

Key Features

Pattern-based Styling
Apply styles based on cell data patterns
Multiple Themes
Built-in color themes for consistent styling
Browser & node, bun, or deno
Works everywhere with platform-specific builds
Sheet Management
Create and manage multiple worksheets

Powerful Features

xldx provides a comprehensive set of features for creating Excel files with advanced styling, theming, and pattern-based formatting - all without dependencies.

Pattern-Based Styling

Apply styles dynamically based on cell data patterns. Create zebra stripes, highlight differences, or color-code values automatically.

createColumn({
  key: 'amount',
  patterns: {
    bgColorPattern: 'zebraBg',
    textPattern: 'colorPerDiff'
  }
})

Type Safe API

Full type definitions for IntelliSense support. Catch errors at compile time with comprehensive type checking.

const xldx = new Xldx(data);
xldx.createSheet(
  { name: 'Report' },
  ...columns
);

Multi-Sheet Workbooks

Create complex workbooks with multiple sheets. Each sheet can have its own data, columns, and styling configuration.

xldx.createSheets([
  { options: sheet1, columns },
  { options: sheet2, columns }
]);

Zero Dependencies

No runtime dependencies means smaller bundle size and fewer security concerns. Clean, minimal implementation.

No ExcelJS No SheetJS 0 Dependencies

Simple API

Browser Usage

import { Xldx } from 'xldx/browser';

const xldx = new Xldx(data);
xldx.createSheet(options, ...columns);

// Download directly
await xldx.download('report.xlsx');

// Or get as Blob
const blob = await xldx.toBlob();

node, bun, or deno Usage

import { Xldx } from 'xldx/server';

const xldx = new Xldx(data);
xldx.createSheet(options, ...columns);

// Write to file
await xldx.write('report.xlsx');

// Or get as Buffer
const buffer = await xldx.toBuffer();

Install xldx

Install xldx as a dependency in your project for node, bun, deno, or browser.

bun add xldx