A Reverse Polish notation calculator implemented with Deno and TypeScript.
Install the Deno runtime 1.0 or newer. Once installed, run the following command:
deno run cli.ts 1 2 +
Or to start the REPL:
deno run cli.ts
You can install it as a shell script running the command:
deno install -n rpn cli.tsThen, you can use it directly:
rpn 1 2 +USAGE:
rpn Start the REPL
rpn [expression] Evaluate an one-line expression
rpn --help Print the help message
EXAMPLES:
rpn => Start the REPL
rpn 1 2 + 3 + 4 + => 10
rpn pi round => 3
Run the tests with the following command:
deno test