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

@ruled/formula

v0.4.0

Published

Excel's formulas worked out in the browser or Node, cell by cell as a workbook changes, with Excel's rules throughout

Readme

@ruled/formula

Excel's calculation on its own. Give it sheets of values and formulas, and it works them out as Excel does and keeps the results up to date as cells change. It needs no editor, no DOM and no server, so it runs in a browser, a worker or Node. It is the engine Ruled's spreadsheet editor, @ruled/sheet, calculates with.

Install

npm install @ruled/formula

Use

import { createWorkbook } from '@ruled/formula';

const book = createWorkbook({
  sheets: {
    Prices: [
      ['Tea', 4.5],
      ['Cake', 3],
      ['Total', '=SUM(B1:B2)'],
    ],
  },
});

book.get('Prices!B3'); // 7.5

// Every value a change moves, each cell once.
book.set('Prices!B1', 10);
// [
//   { cell: 'Prices!B1', value: 10 },
//   { cell: 'Prices!B3', value: 13 },
// ]

// A formula worked out without a cell.
book.evaluate('=XLOOKUP("Cake",Prices!A1:A2,Prices!B1:B2)'); // 3

A string starting with = is a formula, written as in Excel in English. Values are numbers, text, true or false, null for an empty cell, or an error such as { error: '#DIV/0!' }; dates are numbers, as Excel stores them. See cells, changes and formulas for ranges, spills, names, sheets, rows and columns, and dates.

What it calculates

More than 470 of Excel's functions, with Excel's rules for numbers, text, dates, errors and empty cells, including:

  • dynamic arrays that spill into the cells beside them;
  • LET, LAMBDA and its helpers (MAP, REDUCE, SCAN, BYROW and the rest);
  • defined names, references to other sheets, and 3-D references (Jan:Mar!B2);
  • circular references, which calculate as 0, as Excel shows them.

Its answers are checked against Excel's, function by function, with workbooks Excel itself graded.

When to use it

  • Working out a workbook's figures where no one looks at a grid: in a service, a script or a test.
  • Checking what someone typed against a formula before it reaches a sheet.
  • Running a pricing or quoting model written as Excel formulas, with inputs from a form.

To work out a saved .xlsx in Node, set its inputs and save it with its values up to date, use recalculate from @ruled/sheet/node: see recalculating saved workbooks. For people editing workbooks themselves, use the editor, @ruled/sheet.

Licence

MIT.