# jso-ee

> JavaScript Object Expression Evaluator

Latest version **0.26.0-development** (published 2021-12-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install jso-ee
pnpm add jso-ee
yarn add jso-ee
bun add jso-ee
```

## 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.26.0-development |
| Published | 2021-12-03 |
| First published | 2016-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 197.8 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hari Narasimhan |
| Maintainers | harin76 |
| Keywords | JavaScript, expression, evaluator, rule, engine |

## Links

- npm: https://www.npmjs.com/package/jso-ee
- Repository: https://github.com/hari-narasimhan/jso-ee
- Homepage: https://github.com/hari-narasimhan/jso-ee#readme
- Issues: https://github.com/hari-narasimhan/jso-ee/issues
- npm.io page: https://npm.io/package/jso-ee

## Dependencies (4)

- [lodash](https://npm.io/package/lodash.md) 4.17.21
- [mathjs](https://npm.io/package/mathjs.md) 10.0.0
- [dateformat](https://npm.io/package/dateformat.md) ^3.0.3
- [@segment/isodate](https://npm.io/package/@segment/isodate.md) ^1.0.3

## Recent versions

- 0.26.0-development (latest) — 2021-12-03
- 0.26.0 — 2019-06-14
- 0.25.0 — 2019-02-14
- 0.24.0 — 2019-02-14
- 0.23.0 — 2019-01-21
- 0.22.0 — 2018-12-14
- 0.21.0 — 2018-11-25
- 0.20.0 — 2018-11-24
- 0.19.0 — 2018-11-17
- 0.18.0 — 2018-11-08
- 0.17.0 — 2018-10-17
- 0.16.3 — 2018-09-03
- 0.16.2 — 2018-08-23
- 0.16.1 — 2018-08-13
- 0.16.0 — 2018-08-11
- … 22 more at https://npm.io/package/jso-ee/versions

## README

# jso-ee
## JavaScript Object Expression Evaluator

jso-ee is a simple expression parser for objects. it handles arithmetic expression, logical expression assignments and if statement. There is no need to declare variables they are created on the fly and added to the context. The expression language is similar to javascript [ECMAScript 5.1], actually it uses the JavaScript parser written by Colin Ihrig [https://github.com/cjihrig/jsparser] behind the scene.



## Installation
```
  npm install --save-dev jso-ee
```

## Usage
```
  var JSOEE = require('jso-ee');
  var script = `
    charges = cost * 0.5

    if (cost > 10) {
      expensive = true
    }
  `;

  var ctx = { cost : 100 }
  var result = JSOEE.eval(script, ctx);
  // result will be { cost: 100, charges: 50, expensive: true }
```

## Use Cases
jso-ee was written to run rules against a object. It can be used as a simple rule engine.

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