feel-interpreter

1.0.1 • Public • Published

feel-interpreter

feel-interpreter, like the name tells, is an interpreter of FEEL (Friendly Enough Expression Language) language. It works converting the expression written in FEEL into decision logics to return what is expected. FEEL is an expression language based on DMN specification and is a very powerful language built with the purpose of defining rules in Business Rule Engines.

Installation

Installation is done using the npm install command:

$ npm install feel-interpreter

Example Usage

const { convertExpression } = require("feel-interpreter");

const numberComparison = convertExpression("124 in (>=124)");

console.log(numberComparison);
// the output will be: true

const nameInList = convertExpression("Alice in ['Arthur', 'Brad', 'John']");

console.log(nameInList);
// the output will be: false

Valid FEEL expressions (for now)

5 in (<=5)
5 in (>=5)
8++
Brad in ['Arthur', 'Brad', 'John']
Dish==Dish
Dish==Dish and Steak==Steak
Dish==Dish and Steak==Steak and Soda==Soda
Dish==Dish or Steak==Steak
Dish==Dish or Steak==Steak or Soda==Soda
If Car==Car then Car else Bike

Readme

Keywords

Package Sidebar

Install

npm i feel-interpreter

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

6.46 kB

Total Files

4

Last publish

Collaborators

  • pedropereiraassis