Skip to content

Latest commit

 

History

History
49 lines (30 loc) · 1.46 KB

README.md

File metadata and controls

49 lines (30 loc) · 1.46 KB

The Internet Folks Logo

@theinternetfolks/excel-formula

GitHub license Maintainer Downloads

Library to help you parse Excel Formulas to various formats, including JS. A fork of excel-formula suitable for all JS-environments, with the least size.

Installation

Install with npm

  npm install @theinternetfolks/excel-formula

Install with yarn

  yarn add @theinternetfolks/excel-formula

Usage

Convert to Javascript

import { ExcelFormula } from "@theinternetfolks/excel-formula";

console.log(ExcelFormula.toJS(`IF(1 + 1 = 2,"Hello","Goodbye")`));

// (1+1===2?"Hello":"Goodbye")

Get All Tokens

import { ExcelFormula } from "@theinternetfolks/excel-formula";

console.log(ExcelFormula.getTokens(`IF(1 + 1 = 2,"Hello","Goodbye")`));

// F_tokens {TOK_SUBTYPE_STOP: 'stop', items: Array(11), index: -1, add: ƒ, addRef: ƒ, …}

License

MIT