An open-source headless spreadsheet for business web apps
HyperFormula is a headless spreadsheet built in TypeScript, serving as both a parser and evaluator of spreadsheet formulas. It can be integrated into your browser or utilized as a service with Node.js as your back-end technology.
# What HyperFormula can be used for?
HyperFormula doesn't assume any existing user interface, making it a general-purpose library that can be used in various business applications. Here are some examples:
- Custom spreadsheet-like app
- Business logic builder
- Forms and form builder
- Educational app
- Online calculator
# Features
- Function syntax compatible with Microsoft Excel (opens new window) and Google Sheets (opens new window)
- High-speed parsing and evaluation of spreadsheet formulas
- A library of ~400 built-in functions (opens new window)
- Support for custom functions (opens new window)
- Support for Node.js (opens new window)
- Support for undo/redo (opens new window)
- Support for CRUD operations (opens new window)
- Support for clipboard (opens new window)
- Support for named expressions (opens new window)
- Support for data sorting (opens new window)
- Support for formula localization with 17 built-in languages (opens new window)
- GPLv3 license
- Maintained by the team that stands behind the Handsontable (opens new window) data grid
# Documentation
- Client-side installation (opens new window)
- Server-side installation (opens new window)
- Basic usage (opens new window)
- Configuration options (opens new window)
- List of built-in functions (opens new window)
- API Reference (opens new window)
# Integrations
- Integration with React (opens new window)
- Integration with Angular (opens new window)
- Integration with Vue (opens new window)
- Integration with Svelte (opens new window)
# Installation and usage
Install the library from npm (opens new window) like so:
npm install hyperformula
Once installed, you can use it to develop applications tailored to your specific business needs. Here, we've used it to craft a form that calculates mortgage payments using the PMT
formula.
import { HyperFormula } from 'hyperformula';
// Create a HyperFormula instance
const hf = HyperFormula.buildEmpty({ licenseKey: 'gpl-v3' });
// Add an empty sheet
const sheetName = hf.addSheet('Mortgage Calculator');
const sheetId = hf.getSheetId(sheetName);
// Enter the mortgage parameters
hf.addNamedExpression('AnnualInterestRate', '8%');
hf.addNamedExpression('NumberOfMonths', 360);
hf.addNamedExpression('LoanAmount', 800000);
// Use the PMT function to calculate the monthly payment
hf.setCellContents({ sheet: sheetId, row: 0, col: 0 }, [['Monthly Payment', '=PMT(AnnualInterestRate/12, NumberOfMonths, -LoanAmount)']]);
// Display the result
console.log(`${hf.getCellValue({ sheet: sheetId, row: 0, col: 0 })}: ${hf.getCellValue({ sheet: sheetId, row: 0, col: 1 })}`);
Run this code in CodeSandbox (opens new window)
# Contributing
Contributions are welcome, but before you make them, please read the Contributing Guide (opens new window) and accept the Contributor License Agreement (opens new window).
# License
HyperFormula is available under two different licenses: GPLv3 and commercial. The commercial license can be purchased by contacting our team (opens new window) at Handsontable.
Copyright (c) Handsoncode
Demo →