# @dev-syco/quick-math

> Quick calculation from string

Latest version **1.0.14** (published 2020-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dev-syco/quick-math
pnpm add @dev-syco/quick-math
yarn add @dev-syco/quick-math
bun add @dev-syco/quick-math
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.14 |
| Published | 2020-10-09 |
| First published | 2020-02-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 0 |
| Unpacked size | 36.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Pavel Kornienko |
| Maintainers | apoloser |
| Keywords | shunting yard, rpn, reverse polish notation, algorithm, infix, postfix, math, expressions, transformation |

## Links

- npm: https://www.npmjs.com/package/@dev-syco/quick-math
- Repository: https://github.com/dev-syco/quick-math
- Homepage: https://github.com/dev-syco/quick-math#readme
- Issues: https://github.com/dev-syco/quick-math/issues
- npm.io page: https://npm.io/package/@dev-syco/quick-math

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.14 (latest) — 2020-10-09
- 1.0.13 — 2020-03-22
- 1.0.12 — 2020-02-15
- 1.0.11 — 2020-02-15
- 1.0.1 — 2020-02-15
- 1.0.0 — 2020-02-15

## README

# Quick-math
[![codecov](https://codecov.io/gh/dev-syco/quick-math/branch/master/graph/badge.svg)](https://codecov.io/gh/dev-syco/quick-math)
[![Build Status](https://travis-ci.org/dev-syco/quick-math.svg?branch=master)](https://travis-ci.org/dev-syco/quick-math)
### What is this
Implementation of [shunting-yard algorithm](http://en.wikipedia.org/wiki/Shunting-yard_algorithm) to calculate string as mathematical expression.
### How does this work?
While passing expression as infix mathematical expression QuickMath will parse it and transform into [RPN](https://en.wikipedia.org/wiki/Reverse_Polish_notation). After this you can simply calculate result of RPN by calling calculate method. If your expression contains syntax errors class will throw exception.
### Example
```typescript
import { QuickMath } from 'quick-math';
const data = '5/2+25-3^2';

try {
  const expression = new QuickMath(data);
  console.log(expression.calculate() === QuickMath.calculate(data));
} catch (e) {
  console.error(e);
}
```

---
_Source: https://npm.io/package/@dev-syco/quick-math · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
