0.26.0-development • Published 2 years ago

jso-ee v0.26.0-development

Weekly downloads
35
License
MIT
Repository
github
Last release
2 years ago

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.

0.26.0

5 years ago

0.25.0

5 years ago

0.24.0

5 years ago

0.23.0

5 years ago

0.22.0

5 years ago

0.21.0

5 years ago

0.20.0

5 years ago

0.19.0

5 years ago

0.18.0

6 years ago

0.17.0

6 years ago

0.16.3

6 years ago

0.16.2

6 years ago

0.16.1

6 years ago

0.16.0

6 years ago

0.15.0

6 years ago

0.14.0

6 years ago

0.13.0

6 years ago

0.12.0

6 years ago

0.11.0

6 years ago

0.10.0

6 years ago

0.9.0

6 years ago

0.8.0

6 years ago

0.7.0

6 years ago

0.6.0

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago