JSPM

simple-solver

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q30074F

Help you solve simple mathematical expressions

Package Exports

  • simple-solver

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simple-solver) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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