Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/runk/node-reverse-polish-notation

Reverse Polish Notation - Javascript implemenation
https://github.com/runk/node-reverse-polish-notation

Last synced: about 2 months ago
JSON representation

Reverse Polish Notation - Javascript implemenation

Awesome Lists containing this project

README

        

# node-reverse-polish-notation [![Build Status](https://travis-ci.org/runk/node-reverse-polish-notation.svg?branch=master)](https://travis-ci.org/runk/node-reverse-polish-notation)

Reverse Polish Notation - Native Javascript implemenation

## Installation

```shell
npm i reverse-polish-notation
```

## Usage

** see code samples in `./test` directory **

```javascript
var rpn = require('reverse-polish-notation')
console.log(rpn('5 1 2 + 4 * + 3 -')) // prints "14"
console.log(rpn('3 4 5 * -')) // prints "-17"
console.log(rpn('3.1 -4.3 5.6 * -')) // prints "27.18"
```

## References
- https://en.wikipedia.org/wiki/Reverse_Polish_notation

## License

MIT