# infix-to-postfix

> Returns a postfix (Reverse Polish Notation) expression from an infix expression.

Latest version **0.0.3** (published 2017-08-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install infix-to-postfix
pnpm add infix-to-postfix
yarn add infix-to-postfix
bun add infix-to-postfix
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-08-11 |
| First published | 2015-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Miguel Mota |
| Maintainers | miguelmota |
| Keywords | postfix, reverse polish notation, rpn, infix, notation, arithmetic, expression, parse |

## Links

- npm: https://www.npmjs.com/package/infix-to-postfix
- Repository: https://github.com/miguelmota/infix-to-postfix
- Issues: https://github.com/miguelmota/infix-to-postfix/issues
- npm.io page: https://npm.io/package/infix-to-postfix

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2017-08-11
- 0.0.2 — 2015-10-15
- 0.0.1 — 2015-10-15

## README

# infix-to-postfix

> Returns a postfix ([Reverse Polish Notation](https://en.wikipedia.org/wiki/Reverse_Polish_notation)) expression from an [infix](https://en.wikipedia.org/wiki/Infix_notation) expression.

# Demo

[https://lab.miguelmota.com/infix-to-postfix](https://lab.miguelmota.com/infix-to-postfix)

# Install

```bash
npm install infix-to-postfix
```

# Usage

```javascript
const infixToPostfix = require('infix-to-postfix');

console.log(infixToPostfix('1 + 2')); // '1 2 +'
console.log(infixToPostfix('(1 + 2) * (-4)')); // '1 2 + -4 *'
console.log(infixToPostfix('((3 * 4) / (2 + 5)) * (3 + 4)')); // '3 4 * 2 5 + / 3 4 + *'
console.log(infixToPostfix('((57.5 - -34.1) * (6 / 3.2)) + 4.3')); // '57.5 -34.1 - 6 3.2 / * 4.3 +'
console.log(infixToPostfix('a & 5')); // null (invalid expressions return null)
```

Use the [postfix-calculator](https://github.com/miguelmota/postfix-calculator) module for calculating postfix expressions.

# Test

```bash
npm test
```

# Credit

- [Algorithms for Parsing Arithmetic Expressions](http://www.smccd.net/accounts/hasson/C++2Notes/ArithmeticParsing.html)

# License

MIT

---
_Source: https://npm.io/package/infix-to-postfix · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
