Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

simple-solver

0.1.0 • Public • Published

solver

Help you solve simple mathematical expressions.

1 + 1 = 2

API

solver.solve

solver.solve('2 + 2 / (2*1)') === 3;
solver.solve('x + y * 3', {
    x: 1,
    y: 2
}) === 7;

solver.compile

var eq = solver.compile('1 + 3 * x');
eq.solve({ x: 1 }) === 4;
eq.solve({ x: 2 }) === 7;
eq.solve({ x: 3 }) === 10;

Install

Install

npm i simple-solver

DownloadsWeekly Downloads

4

Version

0.1.0

License

none

Last publish

Collaborators

  • avatar