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

@hasna/sheets

v0.1.0

Published

Headless spreadsheet SDK for Hasna-coded apps — a framework-agnostic workbook model with an MIT formula engine (fast-formula-parser), CSV/XLSX/JSON import-export, plus a react-spreadsheet editor shipped from the ./react export

Downloads

180

Readme

@hasna/sheets

npm license

A headless spreadsheet SDK for Hasna-coded apps. It gives you a framework-agnostic workbook model, a real formula engine with dependency-graph recalculation, and CSV / XLSX / JSON import-export — all MIT-licensed. A react-spreadsheet-backed <Spreadsheet> editor is shipped separately from the @hasna/sheets/react entry point so the core stays dependency-light and server-safe.

The formula engine is built entirely on fast-formula-parser (MIT). HyperFormula (GPL-3.0) is deliberately not used.

Install

bun install -g @hasna/sheets   # CLI
# or as a library
bun add @hasna/sheets

The React editor needs the peer deps react, react-dom, and react-spreadsheet; XLSX import/export needs the optional exceljs.

SDK (headless, .)

import {
  createWorkbook,
  setCell,
  setCells,
  getCellValue,
  serializeWorkbook,
} from "@hasna/sheets";

const wb = createWorkbook({ sheetName: "Revenue" });

setCells(wb, {
  A1: "120",
  A2: "150",
  A3: "=SUM(A1:A2)",   // → 270
  B1: "=A3*1.2",       // → 324
});

getCellValue(wb, "A3"); // 270
setCell(wb, "A1", "200"); // recalcs the whole dependency graph
getCellValue(wb, "A3"); // 350

const json = serializeWorkbook(wb, true); // versioned document

Highlights:

  • A1 addressingparseA1, toA1, parseRange, columnIndexToLabel, …
  • Workbook opscreateWorkbook, loadWorkbook, addSheet, renameSheet, removeSheet, setCell, setCells, getRangeValues.
  • Recalc enginerecalc(workbook) builds a cross-sheet dependency graph, evaluates in topological order to a stable fixed point, flags circular references as #CIRCULAR!, and surfaces #DIV/0! and friends.
  • SerializationserializeWorkbook / loadWorkbook with structural validation; loading always recalculates so stored values can never drift.
  • CSVcsvToWorkbook, sheetToCsv, parseCsv, toCsv.
  • XLSX (optional)xlsxToWorkbook, workbookToXlsx (lazy-loads exceljs).

React editor (./react)

import { useState } from "react";
import { Spreadsheet } from "@hasna/sheets/react";
import { createWorkbook, setCells, type Workbook } from "@hasna/sheets";

function Demo() {
  const [wb, setWb] = useState<Workbook>(() => {
    const w = createWorkbook();
    setCells(w, { A1: "1", A2: "2", A3: "=A1+A2" });
    return w;
  });

  return <Spreadsheet workbook={wb} onWorkbookChange={setWb} />;
}

<Spreadsheet> renders the given sheet with live formula results and writes every edit back into a recalculated copy of the model via onWorkbookChange.

CLI

sheets new -o book.json
sheets set book.json A1 5
sheets set book.json A2 "=A1*10"
sheets get book.json A2            # 50
sheets import-csv data.csv -o book.json
sheets export-csv book.json        # computed values (add --raw for formulas)
sheets export-xlsx book.json -o book.xlsx   # requires exceljs
sheets info book.json

Formula support

Formulas are evaluated by fast-formula-parser, which implements ~280 Excel functions (SUM, AVERAGE, COUNT, IF, ROUND, PRODUCT, POWER, SUMIF, VLOOKUP, text/date functions, …), cross-sheet references (=Data!A1), ranges, and full-column refs.

Known engine limitation: [email protected] does not implement MAX / MIN. Use AVERAGE, PRODUCT, SUMIF, etc.; an unsupported function evaluates to #ERROR!.

Dashboard

dashboard/ is a Vite + React + Tailwind SPA that demonstrates the SDK: open a workbook, edit cells, type formulas with live recalc, add/rename sheets, and import a CSV. Build it with bun run build:dashboard; the output ships in dashboard/dist.

Development

bun install
bun test          # unit tests for the SDK core
bun run typecheck # tsc --noEmit
bun run build     # SDK: lib + react + cli + .d.ts
bun run build:all # + dashboard

License

MIT © Hasna. Bundles no GPL code: the formula engine is fast-formula-parser (MIT), the grid is react-spreadsheet (MIT), and XLSX support is exceljs (MIT, optional).