jsepgen
Tiny module (15 LOC) to generate code from the jsep AST.
Example
Convert all variables and functions to an object with the same key
var jsep = ;var gen = ; // parse the expression into an ASTvar ast = // replace variables and functionsvar expr = expr // ((-_.A1 + _.SUM(_.A5, _.A6)) + "%")
It's pretty easy to turn this into a function:
var fn = '_' 'return ' + expr; var total = total // 9%
Installation
npm install jsepgen
Contact
License
MIT