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

@art-of-coding/hyperformula-utils

v0.0.14

Published

Utility functions for HyperFormula

Readme

HyperFormula Utilities

Utility functions for HyperFormula.

Features

  • Parse formulas and get all sheet names
  • Load sheet and all sheets its formulas depend on
  • On-demand loading of sheets for fire-and-forget formulas
  • Sheet builder

Limitations

  • Sheet name must be alphanumeric (case-insensitive)

Install

npm i @art-of-coding/hyperformula-utils

Example

The example below calculates a fire-and-forget formula which dynamically loads the required dependencies on-demand. Dependent sheets are only loaded if no sheet with the name exists.

See the source code for more details.

import { HyperFormula, Sheet } from "hyperformula";
import { calculateFormula } from "@art-of-coding/hyperformula-utils";

const hfInstance = HyperFormula.buildEmpty({
  licenseKey: "gpl-v3",
});

// Our custom resolve function
async function resolve(name: string): Promise<Sheet> {
  if (name === "Sheet1") {
    return [["=Sheet2!B1*Sheet2!C1"]];
  } else if (name === "Sheet2") {
    return [["1", "2", "=A1*B1"]];
  }
  throw new Error(`Sheet "${name}" not found`);
}

// Outputs '22'
console.log(await calculateFormula(hfInstance, "=Sheet1!A1*5.5", resolve));

API Documentation

findDependencies(sheet: Sheet): string[]

Find all dependencies for the given sheet. Will check all formulas for references to other sheets.

import { findDependencies } from "@art-of-coding/hyperformula-utils";

const sheet = [["1", "2", "=AnotherSheet!A1*A1"]];
const dependencies = findDependencies(sheet);

/*
[
  'AnotherSheet'
]
*/

extractFormulas(sheet: Sheet): string[]

Extract all formulas from the sheet. Formulas are any string that starts with =.

import { extractFormulas } from "@art-of-coding/hyperformula-utils";

const sheet = [["1", "2", "=AnotherSheet!A1*A1"]];
const formulas = extractFormulas(sheet);

/*
[
  '=AnotherSheet!:A1*A1'
]
*/

extractSheetNames(formula: string): string[]

Extract all sheet names from a formula.

Sheet names must be alphanumeric.

import { extractSheetNames } from "@art-of-coding/hyperformula-utils";

const sheetNames = extractSheetNames("=AnotherSheet!A1*A1");

/*
[
  '=AnotherSheet'
]
*/

simpleCellAddressFromString(cellAddress: string): { row: number, col: number }

Parse string into a simple cell address. Does not include the sheet property.

The cell address should not contain absolute addresses (e.g. references to other sheets).

import { extractSheetNames } from "@art-of-coding/hyperformula-utils";

const address = simpleCellAddressFromString("A1");

/*
{
  row: 0,
  col: 0
}
*/

Builder

Build sheets by using the A1 notation.

The builder does not use HyperFormula, it has its own implementation. The resulting sheet can easily be added to a HyperFormula instance by using hfInstance.addSheet(sheet).

import { Builder } from "@art-of-coding/hyperformula-utils";

const builder = new Builder();
const sheet = builder
  .setCellContent("A1", "1")
  .setCellContent("B1", "2")
  .setCellContent("C1", "=A1*B1")
  .build();

/*
[ [ '1' ], [ '2' ], [ '=A1*B1' ] ]
*/