# excel-formula

> Methods to beautify an excel formula and convert it to JavaScript or C#

Latest version **1.5.0** (published 2021-03-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install excel-formula
pnpm add excel-formula
yarn add excel-formula
bun add excel-formula
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2021-03-17 |
| First published | 2015-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 2 |
| Unpacked size | 491.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 426 |
| Author | Josh Bennett |
| Maintainers | josh3ennett |

## Links

- npm: https://www.npmjs.com/package/excel-formula
- Repository: https://github.com/joshatjben/excelFormulaUtilitiesJS
- Homepage: http://excelformulabeautifier.com/
- Issues: https://github.com/joshatjben/excelFormulaUtilitiesJS/issues
- npm.io page: https://npm.io/package/excel-formula

## Dependencies (2)

- [jquery](https://npm.io/package/jquery.md) ^3.2.1
- [bootstrap](https://npm.io/package/bootstrap.md) ^4.1.3

## Recent versions

- 1.5.0 (latest) — 2021-03-17
- 1.4.2 — 2017-05-04
- 1.4.1 — 2017-04-08
- 1.4.0 — 2017-03-09
- 1.3.2 — 2017-02-14
- 1.3.1 — 2017-02-13
- 1.3.0 — 2017-02-13
- 1.2.5 — 2017-02-13
- 1.2.4 — 2017-02-12
- 1.2.3 — 2017-02-09
- 1.2.2 — 2016-07-15
- 1.2.1 — 2016-03-22
- 1.1.2 — 2016-02-15
- 1.1.1 — 2016-02-09
- 1.0.1 — 2015-10-13
- … 2 more at https://npm.io/package/excel-formula/versions

## README

# Excel Formula Utilities for JavaScript

[![Build Status](https://travis-ci.org/joshbtn/excelFormulaUtilitiesJS.svg?branch=master)](https://travis-ci.org/joshbtn/excelFormulaUtilitiesJS) [![CDNJS version](https://img.shields.io/cdnjs/v/excel-formula.svg)](https://cdnjs.com/libraries/excel-formula)

Excel Formula Utilities for JavaScript is a library that can be used to
pretty print excel formulas or convert excel formulas into JavaScript.
The JavaScript generated by this library will not execute on it's own.
You'll need to include something like
[formula.js](https://github.com/sutoiku/formula.js/) to cover all the functions
from Excel.

##Install using npm
npm install excel-formula

## Installation for web
Grab the latest js files in the dist folder.

## Basic usage for web
```html
    <script src="excel-formula.js" />
    <script>
        var formattedFormula = excelFormulaUtilities.formatFormulaHTML('IF(1+1=2,"true","false")');
        alert(formattedFormula)
    </script>
```
## Basic Usage for Node
```javascript
    var formula = require('excel-formula');
    var formattedFormula = formula.formatFormula('IF(1+1=2,"true","false")');
    console.log(formatFormula);
```
## Node methods
See basic usage above.
```javascript
    formula.getTokens (formula);
    formula.formatFormula (formula, [opts])
    formula.toJavaScript(formula)
    formula.toCSharp(formula)
```
## Web methods
excelFormulaUtilities is a global variable.
```javascript
    excelFormulaUtilities.getTokens (formula);
    excelFormulaUtilities.formatFormula (formula, [opts]) // This will work fine in a pre tag
    excelFormulaUtilities.formatFormulaHTML(formula) // Use this if you want the output as html.
    excelFormulaUtilities.formula2JavaScript(formula)
    excelFormulaUtilities.formula2CSharp(formula)
```

---
_Source: https://npm.io/package/excel-formula · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
