@theinternetfolks/excel-formula
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: ƒ, …}