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

@hewliyang/headless-spreadjs

v0.0.8

Published

Headless Excel workbook engine for Node.js — powered by SpreadJS with DOM shims. No browser, no Excel, any platform.

Readme

headless-spreadjs

Headless Excel engine for Node.js using SpreadJS. Runs without a browser or Excel.

Features

  • Read/write .xlsx and .xlsm
  • High-fidelity formulas, styles, tables, charts, pivots
  • SpreadJS JSON roundtrip (toJSON / fromJSON)
  • CLI (hsx) for quick workbook ops

System dependencies

canvas requires Cairo/Pango.

# macOS
brew install pkg-config cairo pango libpng jpeg giflib librsvg

# Debian/Ubuntu
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

Install

npm install @hewliyang/headless-spreadjs

SDK quick start

import { init } from "@hewliyang/headless-spreadjs";

const { ExcelFile, dispose } = await init({ licenseKey: "xxx" });

const file = new ExcelFile();
const sheet = file.workbook.getActiveSheet();
sheet.setValue(0, 0, "Name");
sheet.setValue(0, 1, "Score");
sheet.setValue(1, 0, "Alice");
sheet.setValue(1, 1, 95);
await file.save("output.xlsx");

dispose();

CLI quick start

hsx create scores.xlsx
hsx set scores.xlsx A1:B3 '[["Name","Score"],["Alice",95],["Bob",87]]'
hsx get scores.xlsx A1:B3
hsx csv scores.xlsx A1:B3
hsx search scores.xlsx "Alice"
hsx diff before.xlsx after.xlsx
hsx deps scores.xlsx Sheet1!A1

Run hsx --help for all commands.

Daemon (CLI)

hsx uses a background daemon by default to avoid re-initializing SpreadJS on each command.

  • Auto-starts on first use
  • Caches open workbooks
  • Auto-exits after 5 minutes idle
  • Falls back to direct mode if daemon is unavailable

Useful commands:

hsx daemon start
hsx daemon status
hsx daemon flush
hsx daemon stop
hsx --no-daemon get file.xlsx A1
hsx --timeout 120 eval file.xlsx '/* script */'

Environment variables:

| Variable | Default | Purpose | | ------------------- | ---------------- | ---------------------------- | | HSX_SOCKET_PATH | platform default | Custom daemon socket/pipe | | HSX_CACHE_SIZE | 10 | LRU workbook cache size | | HSX_WRITE_THROUGH | 0 | Immediate writes when truthy |

SDK API

init(options?)

Initializes runtime and returns { GC, ExcelFile, dispose }.

  • licenseKey?: string — SpreadJS license key (omit for trial)

ExcelFile

  • new ExcelFile()
  • ExcelFile.open(path)
  • ExcelFile.openFromBuffer(buf)
  • file.save(path)
  • file.saveToBuffer()
  • file.toJSON()
  • file.fromJSON(json)
  • file.batch(fn)
  • file.workbook (raw GC.Spread.Sheets.Workbook)

GC

Full SpreadJS namespace (GC.Spread.Sheets.*) for advanced APIs (styles, enums, tables, formatting, etc).

dispose()

Closes the DOM shim runtime. Call when all workbook work is done.

Concurrency notes

A process supports one active init()/dispose() lifecycle at a time. Multiple ExcelFile instances are fine within that lifecycle.

For isolation, use child processes (not worker threads).

Docker

FROM node:20-slim
RUN apt-get update && apt-get install -y \
    build-essential libcairo2-dev libpango1.0-dev \
    libjpeg-dev libgif-dev librsvg2-dev \
    && rm -rf /var/lib/apt/lists/*

License

MIT for this package. SpreadJS requires a separate commercial license from MESCIUS.