@danielsimonjr/mathts-evaluator
v0.1.2
Published
Standalone compiler + evaluator for MathTS expressions, re-exported as a focused package
Maintainers
Readme
@danielsimonjr/mathts-evaluator
Standalone compiler + evaluator for MathTS expressions.
A focused entry point over the evaluation half of
@danielsimonjr/mathts-expression.
The implementation is re-exported, not duplicated. Completes the
parse -> compile -> evaluate pipeline alongside
@danielsimonjr/mathts-parser.
Install
npm install @danielsimonjr/mathts-evaluatorWhat it exports
compile-- compile a parsed AST node against a math scope into an executable form.createEvaluate-- build anevaluate(expr, scope?)function from aparsefunction + math scope.compileExpression-- compile an expression string directly.- Types:
CompiledExpression,Scope.
import { createEvaluate } from '@danielsimonjr/mathts-evaluator';
import { createParse } from '@danielsimonjr/mathts-parser';
// wire createParse into your math scope, then:
// const evaluate = createEvaluate(parse, mathScope);
// evaluate('2 + 3'); // 5License
MIT (c) Daniel Simon Jr.
