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

xldx

v0.0.1

Published

A powerful Excel file builder for TypeScript/JavaScript with advanced styling and theming capabilities

Readme

xldx

Excel file builder for TypeScript/JavaScript with zero dependencies.

Installation

npm install xldx
# or
bun add xldx

Features

  • 📦 Zero dependencies - Pure TypeScript implementation
  • 🎨 Pattern-based styling and theming
  • 📊 Multi-sheet support
  • 🚀 TypeScript first with full type safety
  • 🌐 Works in browsers and Node.js
  • 🎯 < 17KB minified

Quick Start

import { Xldx } from 'xldx';

// Sample data
const data = [
  { id: 1, name: 'John', age: 30, status: 'active' },
  { id: 2, name: 'Jane', age: 25, status: 'inactive' },
  { id: 3, name: 'Bob', age: 35, status: 'active' }
];

// Create Excel builder
const xlsx = new Xldx(data);

// Create a sheet with columns
xlsx.createSheet(
  { name: 'Users' },
  { key: 'id', header: 'ID', width: 10 },
  { key: 'name', header: 'Name', width: 20 },
  { key: 'age', header: 'Age', width: 10 },
  { key: 'status', header: 'Status', width: 15 }
);

// Node.js - write to file
await xlsx.write('users.xlsx');

// Browser - trigger download
await xlsx.download('users.xlsx');

// Get raw data
const buffer = await xlsx.toBuffer(); // Node.js Buffer
const uint8Array = await xlsx.toUint8Array(); // Uint8Array
const blob = await xlsx.toBlob(); // Browser Blob

Advanced Usage

Themes

import { Xldx, themes } from 'xldx';

const xlsx = new Xldx(data);
xlsx.setTheme(themes.dark);

Pattern-Based Styling

xlsx.createSheet(
  { name: 'StyledSheet' },
  {
    key: 'status',
    header: 'Status',
    patterns: {
      bgColorPattern: (context) => {
        if (context.value === 'active') {
          return { fill: { type: 'pattern', pattern: 'solid', fgColor: '90EE90FF' } };
        }
        return null;
      }
    }
  }
);

Zebra Striping

xlsx.createSheet(
  { name: 'ZebraSheet' },
  {
    key: 'data',
    patterns: {
      bgColorPattern: 'zebra' // Built-in zebra pattern
    }
  }
);

API

Constructor

new Xldx(data: DataRow[] | SheetsData, options?: XldxOptions)

Methods

  • setTheme(theme: ColorTheme): this - Set the color theme
  • createSheet(options: SheetOptions, ...columns: ColumnDefinition[]): this - Create a new worksheet
  • createSheets(sheets: Array<{options: SheetOptions; columns: ColumnDefinition[]}>): this - Create multiple worksheets
  • toBuffer(): Promise<Buffer> - Generate Excel file as Buffer (Node.js)
  • toUint8Array(): Promise<Uint8Array> - Generate Excel file as Uint8Array
  • toBlob(): Promise<Blob> - Generate Excel file as Blob (Browser)
  • download(filename?: string): Promise<void> - Trigger file download (Browser only)
  • write(filePath: string): Promise<void> - Write Excel file to disk (Node.js only)
  • toJSON(): any - Export workbook structure as JSON
  • static fromJSON(json: any): Xldx - Create from JSON structure
  • static read(data: Uint8Array | Buffer): Promise<any> - Read XLSX file

Development

# Install dependencies
bun install

# Run tests
bun test

# Build
bun run build

# Lint
bun run lint

# Type check
bun run typecheck

License

MIT