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

@syncfusion/ej2-calculate

v35.1.40

Published

JavaScript formula calculation engine for Syncfusion Spreadsheet and compatible workbook/xlsx hosts

Downloads

8,284

Readme

JavaScript Calculate Library

Using this package with an AI coding agent

Before generating Syncfusion code, ask your AI coding agent to run the Syncfusion setup using the following prompt:

Set up this project for Syncfusion before generating code. Fetch
and follow the official instructions at https://ai.syncfusion.com,
then report the detected platform, installed skill pack, MCP
status, and any required licensing action.

The setup detects your project’s platform and loads the appropriate Syncfusion skill pack. No Syncfusion account or MCP key is required to install or read Syncfusion agent skills.

Platform reference: https://ai.syncfusion.com/javascript/llms.txt

The JavaScript Calculate library is an Excel-compatible formula calculation engine that parses and evaluates Excel-like / ECMA-376 formulas in any JavaScript or TypeScript application. It powers the built-in formula support of the JavaScript Spreadsheet and can also be used standalone against a simple key/value store or hosted against any workbook / grid model through ICalculateHost.

Setup

To install the Calculate library, use the following command.

npm install @syncfusion/ej2-calculate

@syncfusion/ej2-base is the single runtime dependency and is installed automatically. If you consume the engine through the Spreadsheet, install @syncfusion/ej2-spreadsheet instead — the Calculate library ships built in and requires no separate wiring.

Supported frameworks

The Calculate library is headless (UI-independent), so it runs wherever JavaScript or TypeScript runs. It is consumed by the Spreadsheet control across the following framework wrappers.

|      Angular     |        React       |        Vue          |   ASP.NET Core   |   ASP.NET MVC   | | :-----: | :-----: | :-----: | :-----: | :-----: |

Key features

  • Built-in formula library ~367 pre-defined Excel-compatible / ECMA-376 functions across math, trigonometry, statistical, financial, logical, text, date-time, lookup and reference, engineering, database, information, matrix, complex-number, and array categories.
  • Custom functions : Register user-defined functions with defineFunction and evaluate them alongside the built-in catalog.
  • Named ranges: Assign meaningful names to cells or ranges and refer them in formulas.
  • Dependency tracking and recalculation: Automatic and Manual calculation modes driven by a cell dependency graph, including volatile functions such as RAND and NOW.
  • Culture-aware argument separators: Evaluate culture-based formulas with locale-specific argument separators and formatted numeric arguments.
  • Multi-sheet references: Refer cells and ranges across sheets of the same workbook.
  • Standard Excel error tokens: #DIV/0!, #VALUE!, #REF!, #NAME?, #N/A, #NULL!, #NUM!, and more.
  • Headless key/value mode: Evaluate formulas against a simple key/value store with no workbook or UI.
  • Host adapter (ICalculateHost): Integrate with any workbook / grid / xlsx model — Spreadsheet's Workbook implements it out of the box.

Getting started

The engine works with the Spreadsheet out of the box — a Calculate instance is created and wired internally. The following snippets cover the standalone and hosted modes.

Standalone (key / value) — quickest way to try the engine

import { Calculate } from '@syncfusion/ej2-calculate';

const calculate = new Calculate();
calculate.setKeyValue('A1', '10');
calculate.setKeyValue('B1', '20');
calculate.setKeyValue('C1', '=A1+B1');

console.log(calculate.getKeyValue('C1')); // 30
console.log(calculate.computeExpression('=SUM(1,2,3)')); // 6

calculate..destroy(); // clear maps / listeners when finished

Custom functions

calculate.defineFunction('DOUBLE', (x: string | number) => Number(x) * 2, 'Doubles a number', 'Custom');
console.log(calculate.computeFormula('=DOUBLE(21)')); // 42

Hosted mode (Spreadsheet / workbook / custom grid)

Implement ICalculateHost and pass the host into the constructor.

import { Calculate, ICalculateHost } from '@syncfusion/ej2-calculate';

const host: ICalculateHost = {
  getValueRowCol(sheetFamilyID, row, col) {
    /* read cell value for 1-based row/col */
    return '';
  },
  setValueRowCol(sheetFamilyID, value, row, col) {
    /* write calculated value back to the model */
  },
  getSheetInfo() {
    return []; /* { visibleName, sheet }[] */
  },
  parseDate(value) {
    return {}; /* culture-aware date parse result */
  }
};

const calculate = new Calculate(host);
const familyId = calculate.createSheetFamilyID();
calculate.registerGridAsSheet('Sheet1', host, familyId);

Resources

Support

Product support is available through the following mediums.

Changelog

Check the changelog here. Get minor improvements and bug fixes every week to stay up to date with frequent updates.

License and copyright

This is a commercial product and requires a paid license for possession or use. Syncfusion® licensed software, including this library, is subject to the terms and conditions of Syncfusion® EULA. To acquire a license for 140+ JavaScript UI controls, you can purchase or start a free 30-day trial.

A free community license is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue and five or fewer developers.

See LICENSE FILE for more info.

© Copyright 2026 Syncfusion® Inc. All Rights Reserved. The Syncfusion® Essential Studio® license and copyright applies to this distribution.