mathematician
Arithmetical expressions parser for JavaScript. 数学者!
Available on NPM: https://www.npmjs.com/package/mathematician
Examples
It splits expressions into atomic symbols for easy programming handling.
;// returns them: type: SYMBOL_TYPENUMBER value: -314 type: SYMBOL_TYPENUMBER value: 057 type: SYMBOL_TYPESUM value: null ;// throws error indexing failing token:Error'2'
And may also safely evaluate whole expressions following postfix notation:
;// returns the result:7 ;// throws error messaging arithmetical inconsistency:Error'Division by zero'