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

@xsanisty/calxjs

v3.0.1

Published

Spreadsheet Calculation Engine

Readme

jQuery Calx 3.0

Version TypeScript License Tests

Modern spreadsheet-like calculation engine for the web

Transform your HTML forms into powerful spreadsheet calculators with real-time formula evaluation, cell dependencies, and Excel-compatible functions.

DocumentationExamplesLegacy Docs


✨ Features

  • 🔧 TypeScript Rewrite - Complete modern rewrite with improved type safety
  • Dynamic Dependencies - Automatic dependency tracking and calculation
  • 💰 Input Masking - Built-in formatters (currency, percent, number, etc.)
  • 🎨 Conditional Styling - Apply CSS styles based on cell values
  • 🏷️ Named Variables - Use readable names instead of cell addresses
  • 📊 Multi-Sheet Support - Work with multiple calculation sheets
  • 🚀 Auto Addresses - Formula cells get automatic CALX addresses
  • 📱 Responsive - Mobile-friendly with modern UI
  • 🧮 Excel Functions - 400+ Excel-compatible functions via FormulaJS
  • 🔄 Backward Compatible - Works with jQuery Calx 2.x code

🚀 Quick Start

Installation

Via NPM

npm install @xsanisty/calxjs

Via CDN (Coming Soon)

<!-- jQuery (required for plugin) -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

<!-- jQuery Calx -->
<script src="https://cdn.jsdelivr.net/npm/@xsanisty/[email protected]/dist/jquery.calx.js"></script>

Basic Example

<form id="calculator">
    <input type="number" data-cell="A1" value="10">
    <input type="number" data-cell="A2" value="20">
    <input type="text" data-formula="A1+A2" readonly>
</form>

<script>
    $('#calculator').calx();
</script>

With Formatters

<form id="invoice">
    <input data-cell="A1" data-var="PRICE" value="100" data-format="currency">
    <input data-cell="A2" data-var="QTY" value="5">
    <input data-cell="A3" data-var="TAX" value="0.08" data-format="percent">
    <input data-formula="PRICE*QTY*(1+TAX)" data-format="currency" readonly>
</form>

<script>
    $('#invoice').calx({ autoCalculate: true });
</script>

📚 Documentation

💡 Examples

Explore interactive examples in the examples/ directory:

📖 Usage

jQuery Plugin

// Initialize
$('#form').calx({
    autoCalculate: true,
    data: {
        A1: { value: 100, format: 'currency' }
    },
    variables: {
        TAX: 'A1'
    },
    functions: {
        CUSTOM: function(x) { return x * 2; }
    }
});

// Methods
$('#form').calx('getCellValue', 'A1');
$('#form').calx('setCellValue', 'A1', 100);
$('#form').calx('calculate');

TypeScript API

import { Calx } from '@xsanisty/calxjs';

const workbook = Calx.createWorkbook();
const sheet = workbook.createSheet('sheet1');

sheet.mount('#element');
sheet.setCell('A1', 10);
sheet.setCell('A2', 20);
sheet.setCell('A3', '=A1+A2');

sheet.calculate();
console.log(sheet.getCell('A3').value); // 30

🔧 Development

Prerequisites

  • Node.js 16+
  • npm or yarn

Setup

# Install dependencies
npm install

# Build both core and jQuery plugin
npm run build

# Run tests
npm test

# Run tests in watch mode
npm test:watch

# Generate coverage report
npm run test:coverage

Build Commands

| Command | Description | |---------|-------------| | npm run build | Build both core and jQuery plugin | | npm run build:core | Build core library only | | npm run build:jquery | Build jQuery plugin only | | npm run build-parser | Regenerate formula parser (rarely needed) |

Project Structure

calx.js/
├── src/                    # TypeScript source
│   ├── Calx.ts            # Main entry point
│   ├── Calx/              # Core classes
│   │   ├── Cell.ts
│   │   ├── Sheet.ts
│   │   ├── Workbook.ts
│   │   ├── Formula/       # Formula engine
│   │   ├── Parser/        # Expression parser
│   │   └── Utility/       # Helper functions
│   └── jquery.calx.ts     # jQuery plugin
├── dist/                   # Compiled output
│   ├── calx.js            # Core library
│   └── jquery.calx.js     # jQuery plugin
├── examples/               # Live examples
├── test/                   # Jest tests
├── docs/                   # Documentation
└── legacy/                 # jQuery Calx 2.x

🧪 Testing

Currently 209 out of 223 tests passing (93.7%).

# Run all tests
npm test

# Watch mode
npm test:watch

# With coverage
npm run test:coverage

# Performance benchmarks
npm run test:performance

Performance Benchmarks

The test suite includes comprehensive performance tests that measure:

  • Formula Parsing - 1000+ formulas in <2s
  • Calculation Speed - 1000 cells in <1s
  • Dependency Chains - 100-cell chain in <500ms
  • Large Datasets - 10x100 grid (1000 cells) in <3s
  • SUM Ranges - 10 SUMs over 1000 cells in <1s
  • Complex Formulas - Nested IF, SUMIF, mathematical operations
  • Multi-Sheet - Cross-sheet references
  • Real-World Scenarios - Invoice calculations, mortgage amortization

Run npm run test:performance to see detailed timing metrics for your system.

🤝 Contributing

Contributions are welcome! Please read our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

MIT License - see LICENSE file for details.

🙏 Acknowledgments

  • Original jQuery Calx 2.x by @xsanisty
  • FormulaJS for Excel function implementations
  • Chevrotain for parser infrastructure
  • All contributors and users of jQuery Calx

📞 Support


Made with ❤️ by Xsanisty

⭐ Star us on GitHub — it helps!

GitHubnpm