Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/pie-framework/expression-parser

A simple math expression parser/calculator
https://github.com/pie-framework/expression-parser

Last synced: about 1 month ago
JSON representation

A simple math expression parser/calculator

Awesome Lists containing this project

README

        

# expression-parser

A simple math expression parser/calculator.

```javascript
import {calculate} from '@pie-framework/expression-parser';

calculate('2 + log(10) * sin(22)').value // => 1.9911486907

```

## Install

```shell
npm install @pie-framework/expression-parser
#or
yarn add @pie-framework/expression-parser
```

## supported

Have a look at the tests. Most basic functions you'd find on a scientific calculator.

> implicit multiplication: `2(4) = 8` isn't supported at the moment