yaam
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

yaam - Yet Another Arithmetics Module

Calculates arithmetic expressions without using eval().

import {calculate, tryCalculate} from 'yaam'

calculate("2 ^ 3 * (4 + 5)") // => 72
calculate("foo") // ERROR

tryCalculate("2.5 % 2") // => 0.5
tryCalculate("foo") // null
tryCalculate("foo", { verbose: true }) // null, but logs to console

Package Sidebar

Install

npm i yaam

Weekly Downloads

3

Version

1.1.1

License

MIT

Unpacked Size

12.3 kB

Total Files

6

Last publish

Collaborators

  • jaynetics