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

@justybase/spreadsheet-tasks

v1.1.0

Published

High-performance TypeScript library for reading and writing Excel files in XLSB and XLSX formats. XLSB is 3.3x faster to write and 2.1x faster to read than XLSX.

Downloads

300

Readme

SpreadsheetTasks

A high-performance TypeScript library for reading and writing Excel files in XLSB and XLSX formats.

npm version License: MIT

🚀 Features

  • High Performance - XLSB format is 3.3x faster to write and 2.1x faster to read than XLSX
  • Small File Size - XLSB files are ~47% smaller than equivalent XLSX files
  • TypeScript First - Full TypeScript support with type definitions
  • Dual Format Support - Read and write both XLSB and XLSX formats
  • Zero External Dependencies - Uses only Node.js built-in modules and minimal zip libraries
  • Streaming Support - Efficient memory usage for large files
  • Multiple Sheets - Support for multiple worksheets per workbook
  • Auto-filter - Automatic filter headers support

📊 Benchmark Results

| Operation | XLSB | XLSX | Performance Gain | |-----------|------|------|------------------| | Write (50K rows) | 140 ms | 467 ms | 3.3x faster | | Read (50K rows) | 118 ms | 276 ms | 2.3x faster | | File Size | 1.49 MB | 2.83 MB | 47% smaller |

📦 Installation

npm install @justybase/spreadsheet-tasks

🔧 Quick Start

Writing Excel Files

import { XlsbWriter, XlsxWriter } from '@justybase/spreadsheet-tasks';

// Create XLSB file (recommended for performance)
const xlsbWriter = new XlsbWriter('output.xlsb');
xlsbWriter.addSheet('Sheet1');
xlsbWriter.writeSheet([
    ['Name', 'Age', 'City'],
    ['Alice', 30, 'New York'],
    ['Bob', 25, 'Los Angeles'],
    ['Charlie', 35, 'Chicago']
]);
await xlsbWriter.finalize();

// Or create XLSX file for compatibility
const xlsxWriter = new XlsxWriter('output.xlsx');
xlsxWriter.addSheet('Sheet1');
xlsxWriter.writeSheet([
    ['Name', 'Age', 'City'],
    ['Alice', 30, 'New York'],
    ['Bob', 25, 'Los Angeles'],
    ['Charlie', 35, 'Chicago']
]);
await xlsxWriter.finalize();

Streaming API (for Large Datasets)

For large datasets that don't fit in memory, use the streaming API to write rows one at a time:

import { XlsbWriter } from '@justybase/spreadsheet-tasks';

const writer = new XlsbWriter('large-output.xlsb');

// Start a sheet with column count and optional headers
writer.startSheet('Data', 5, ['ID', 'Name', 'Value', 'Date', 'Active']);

// Write rows one at a time - no need to load all data in memory
for (let i = 0; i < 1_000_000; i++) {
    writer.writeRow([
        i + 1,
        `User_${i + 1}`,
        Math.random() * 10000,
        new Date(),
        i % 2 === 0
    ]);
}

// Finalize the sheet
writer.endSheet();

// You can create multiple sheets
writer.startSheet('MoreData', 3, ['Col1', 'Col2', 'Col3']);
// ... write more rows
writer.endSheet();

await writer.finalize();

Benefits of Streaming API:

  • ✅ Constant memory usage regardless of dataset size
  • ✅ Write millions of rows without loading all data into RAM
  • ✅ Generate data on-the-fly from databases, APIs, or other sources
  • ✅ Same performance as batch mode

Reading Excel Files

import { XlsbReader, XlsxReader, ReaderFactory } from '@justybase/spreadsheet-tasks';

// Using ReaderFactory (auto-detects format)
const reader = ReaderFactory.create('data.xlsb');
await reader.open('data.xlsb');

console.log('Sheet names:', reader.getSheetNames());

while (reader.read()) {
    const row = [];
    for (let i = 0; i < reader.fieldCount; i++) {
        row.push(reader.getValue(i));
    }
    console.log(row);
}

// Or use specific reader
const xlsbReader = new XlsbReader();
await xlsbReader.open('data.xlsb');
// ... same API as above

📖 API Documentation

See API Documentation for detailed API reference.

💡 Examples

Check out the examples folder for more usage examples:

Run examples with:

npm run build
npx ts-node examples/basic-write.ts

🔍 When to Use XLSB vs XLSX

| Use XLSB When | Use XLSX When | |---------------|---------------| | Performance is critical | Need maximum compatibility | | Working with large datasets | Sharing with older Excel versions | | Internal/backend processing | Human-readable XML is needed | | Storage space is limited | Third-party integrations require it |

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments