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

excel-builder-vanilla

v5.3.1

Published

An easy way of building Excel files with javascript

Readme

Excel-Builder-Vanilla

Documentation

📘 Documentation website powered by GitBook

Live Demo

Available Live demo which displays a rough WYSIWYG (What You See Is What You Get) idea of all available options/methods.

Installation

npm install excel-builder-vanilla
// ESM - npm install
import { createWorkbook } from 'excel-builder-vanilla';

Types omit private implementation members, including underscore-prefixed class members, for compatibility with @excel-builder-vanilla/types. Use public methods such as setHeader() and setRowInstructions() to configure worksheets.

Basic Usage

import { downloadExcelFile, Workbook } from 'excel-builder-vanilla';

const originalData = [
  ['Artist', 'Album', 'Price'],
  ['Buckethead', 'Albino Slug', 8.99],
  ['Buckethead', 'Electric Tears', 13.99],
  ['Buckethead', 'Colma', 11.34],
];
const artistWorkbook = new Workbook();
const albumList = artistWorkbook.createWorksheet({ name: 'Artists' });
albumList.setData(originalData);
artistWorkbook.addWorksheet(albumList);

downloadExcelFile(artistWorkbook, 'Artist WB.xlsx');

Large exports and streams

createExcelFile() serializes worksheet rows directly and yields periodically during XML generation. It returns a complete Blob or Uint8Array. Use createExcelFileStream() to consume incremental XLSX ZIP output: browsers receive a ReadableStream<Uint8Array> and Node receives an async generator.

import { createExcelFileStream } from 'excel-builder-vanilla';

const output = createExcelFileStream(artistWorkbook, {
  chunkSize: 64 * 1024,
  zipOptions: { level: 1 },
});

if ('getReader' in output) {
  const reader = output.getReader();
  try {
    while (true) {
      const { value, done } = await reader.read();
      if (done) break;
      await writeToDestination(value);
    }
  } catch (error) {
    await reader.cancel();
    throw error;
  } finally {
    reader.releaseLock();
  }
} else {
  for await (const chunk of output) await writeToDestination(chunk);
}

writeToDestination represents your destination's byte-writing function. chunkSize limits output bytes per chunk and must be a positive integer. Generation follows reader demand; cancelling the reader or returning from the Node iteration stops export. The workbook retains its input rows and shared strings, and each media payload is decoded before compression. Very wide rows, many unique strings, and large style/drawing collections still affect memory usage. Keep worksheet data and configuration stable until export completes.

Streaming always produces XLSX bytes. The existing outputType, fileFormat, mimeType, and downloadType options remain accepted with their previous behavior: they do not alter the stream output or select the environment. Set the filename and MIME type on your destination. Compression defaults to level 6. Level 1 trades some file size for faster export; choose a level using your own data.

Reuse styles

Create a style once and reuse its ID across cells. Every createFormat() call allocates a new format and may allocate nested font, fill, border, and number formats.

const amountStyle = artistWorkbook.getStyleSheet().createFormat({ format: '0.00' });
albumList.setData([
  [{ value: 8.99, metadata: { style: amountStyle.id } }],
  [{ value: 13.99, metadata: { style: amountStyle.id } }],
]);

Export validation

Normal and streaming ZIP exports reject entry paths containing . or .. segments, empty segments, backslashes, colons, or control characters. A single leading package slash is accepted. This also applies to media filenames and custom generateFiles() output; validation happens when exporting, not in addMedia().

XML serialization rejects element and attribute names containing markup delimiters or control characters, including malformed style keys. XMLNode.setAttribute() rejects names that would overwrite node members, such as __proto__, children, or toString. Ordinary attribute updates and removal with null remain supported. These checks do not validate the full XML/OOXML schema or sanitize custom XML strings supplied by exporters.

Changelog

CHANGELOG

LICENSE

MIT License

Major Changes

  • version 3.0 - initial release (forked from original excel-builder library)
  • version 4.0 - build as ESM-Only and drop CJS (CommonJS) build (aka require())
  • version 5.0 - drop the legacy IIFE build and the use of window object (legacy <script> loading)