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

@oniryk/xlsx

v0.0.4

Published

A lightweight, efficient TypeScript library for generating single-sheet Excel XLSX files with support for large datasets

Readme

@oniryk/xlsx

A lightweight, efficient TypeScript library for generating single-sheet Excel XLSX files with support for large datasets

Features

  • Optimized for large datasets
  • Support for dates, numbers, and text content
  • Custom column widths
  • TypeScript types included

Installation

npm install @oniryk/xlsx

Quick Start

import { SharedStrings, Sheet, build } from '@oniryk/xlsx';

// Create instances for string management and worksheet
const strings = new SharedStrings();
const sheet = new Sheet(strings);

// Add headers
sheet.addRow(['Name', 'Age', 'Date']);

// Add data
sheet.addRow(['John Doe', 25, new Date('2024-01-31')]);
sheet.addRow(['Jane Smith', 30, new Date('2024-02-15')]);

// Generate the Excel file
const buffer = await build(sheet, strings);

// Save to file or send as response
await fs.writeFile('output.xlsx', buffer);

API Reference

SharedStrings

Manages string deduplication across the workbook:

const strings = new SharedStrings();

Methods:

  • add(str: string): number - Adds a string to the shared strings table
  • size(): number - Gets the total number of unique strings
  • destroy(): void - Cleans up resources

Sheet

Handles worksheet data and formatting:

const sheet = new Sheet(sharedStrings);

Methods:

  • addRow(row: Row): void - Adds a single row
  • addRows(rows: Row[]): void - Adds multiple rows
  • rowsCount(): number - Gets total row count
  • setColumWidth(index: number, width: number): void - Sets width for a single column
  • setColumWidth(sizes: [number, number][]): void - Sets widths for multiple columns

Types

type Cell = string | number | Date | null;
type Row = Cell[];

Column Width Configuration

You can customize column widths either individually or in bulk:

// Set single column width
sheet.setColumWidth(0, 15); // Set column A to width 15

// Set multiple column widths
sheet.setColumWidth([
  [0, 15], // Column A: width 15
  [1, 20], // Column B: width 20
  [2, 10]  // Column C: width 10
]);

Date Handling

Dates are automatically converted to Excel's internal format and styled appropriately:

sheet.addRow(['Date', new Date('2024-01-31')]);

Limitations

Current version limitations:

  1. Single Sheet Only: The library currently only supports generating Excel files with a single worksheet. Multi-sheet support is planned for future releases.
  2. Basic Styling: Only basic cell formatting is supported (dates and numbers). Advanced styling features like colors, borders, and fonts are not yet implemented.

Contributing

Contributions are welcome! Please ensure:

  1. TypeScript types are maintained
  2. Documentation is updated
  3. Code follows the existing style

License

Distributed under the ISC License. See LICENSE for more information.

This documentation was generated using AI tools. Please report any inaccuracies through GitHub issues.