Reverse Polish Notation calculator/converter for js
npm install rpnccThis is a program for Reverse Polish notation utility.
It converts or calculates a expressions to Reverse Polish notation.
console
$ npm install rpncc
`Import this module in your source code and call like below.
`javascript
var Rpn = require('rpncc');
var rpn = new Rpn();console.log(rpn.convert(["1", "+", "2", "", "3"])); // -> [ '1', '2', '3', '', '+' ]
console.log(rpn.calculate([ '1', '2', '3', '*', '+' ])); // -> 7
console.log(rpn.revert([ '1', '2', '3', '', '+' ])); // -> ["1", "+", "2", "", "3"]
`Testing
rpncc uses ava for testing. You can run test cases by installing dependencies then run "npm test" command.
`console
$ npm install
$ npm test
``