json-logical-engine
v1.1.4
Published
A simple, powerful, and clean way to handle complex operations that can be defined through a JSON
Downloads
5
Maintainers
Readme
JSON logical engine
This lib still under development
Core concepts
We have 3 main components that you need to understand:
Engine
- The engine is the component that will run the operators with operations
- Can be customized with a certain set of options like logging or custom operators
Operators
- The functions that can be executed during the engine execution
- Can be async
- Supports schema validation
Operations
- The instructions of what will be executed
- Can be nested within other operation
- The arguments can be other operations
Pre built operators
We have a set of pre built opreators:
Logic Operations
if:
If the operationseq:
Deep equality checkneq:
Negation of the deep equality checkor:
|| Behaviour
and:
&& Behaviour
Arithmetic Operations
add:
Adds a list of numberssubtract:
Subtracts two numbersdivide:
Divides one number by othermultiply:
Multiplies a list of numbers
Numeric Operations
gt:
Greater thangte:
Greater than or equallt:
Less thanlte:
Less than or equal