Is there any rules engine implemented on NodeJS / in Javascript?
Asked Answered
W

6

40

I need a lightweight rules engine. We have around 50 rules right now, but the rules keep changing frequently.

We could use Drools, but I figure that would be overkill. Are there any lighter, F/OSS implementations?

I am aware of the other similar question, but that is 2 years old and does not have a good answer. (and I do not have enough rep to comment on that question)

Wyon answered 25/1, 2012 at 11:13 Comment(2)
related: #3431385 https://mcmap.net/q/408592/-rule-engine-in-javascript-closedVaunt
@DanD. Thanks for the links, although the 1st one is more than a year old (which is the one I mentioned in the question explanation itself). The 2nd link - JSONRules - seems promising, although seems to be limited to manipulating DOM objects, at first glance. Thanks for that though, had missed that earlier.Wyon
C
13

I'm much later as well, but since you're asking for a lighter option, consider json-rules-engine. I authored this library in an attempt to create a simple, performant rules engine with easy rule persistence (rules are expressed in json).

It's not meant as an enterprise solution, and is less ambitious than nools. Many businesses have relatively basic needs when it comes to rules engines: boolean logic, comparison operators, and (ideally) human readable rules.

Your use case of having only 50 rules that change often(i.e. highly configurable), is really the target audience for this library.

Catheycathi answered 24/7, 2016 at 18:26 Comment(1)
There's also a simplified version: github.com/RxNT/json-rules-engine-simplifiedLexicologist
P
20

There's also nools, give it a try.

Parabolic answered 10/4, 2012 at 1:24 Comment(2)
Nools is now / deprecated: "C2FO is no longer maintaining this project. Please use accordingly. If you would like to help maintain or take over the project please let us know."Interstitial
Changing my accepted answer because Nools is deprecated.Wyon
C
13

I'm much later as well, but since you're asking for a lighter option, consider json-rules-engine. I authored this library in an attempt to create a simple, performant rules engine with easy rule persistence (rules are expressed in json).

It's not meant as an enterprise solution, and is less ambitious than nools. Many businesses have relatively basic needs when it comes to rules engines: boolean logic, comparison operators, and (ideally) human readable rules.

Your use case of having only 50 rules that change often(i.e. highly configurable), is really the target audience for this library.

Catheycathi answered 24/7, 2016 at 18:26 Comment(1)
There's also a simplified version: github.com/RxNT/json-rules-engine-simplifiedLexicologist
S
6

I've made a new node package called node-clips which allows you to integrate the popular CLIPS (C Language Integrated Production System) rule engine into your node applications.

https://github.com/atrniv/node-clips

CLIPS is a productive development and delivery expert system tool which provides a complete environment for the construction of rule and/or object based expert systems. Created in 1985, CLIPS is now widely used throughout the government, industry, and academia.

Checkout the official CLIPS documentation for more information : http://clipsrules.sourceforge.net/

Seleucia answered 24/3, 2013 at 11:49 Comment(0)
W
6

I am even later to the game, but if people are still looking, durable_rules is a great project that I have been using.

durable_rules stores state in redis and uses a Rete algorithm that Jesus Ruiz cooked up to do inference in a distributed way. The project is actively supported and even has TypeScript support if you are into that sort of thing.

Winthrop answered 30/6, 2016 at 22:59 Comment(1)
This looks good! Simple and polyglot (python, js, ruby, ...) since v2. Great thanksLexicologist
E
5

I develop this one. Hope you found interesting to you needs.

From description:

Business Rules Engine is a kind of software developed to support environments where the rules changes in a regular base like risk evaluation, text analysis, data mining and others softwares designed to decision making.

Excitor answered 8/3, 2014 at 19:53 Comment(0)
P
5

I'm obviously very late to the game here but I've used node-rules with some success.

Pontoon answered 22/9, 2015 at 15:17 Comment(1)
Simple and efficient, this seems also a good choice. I'm adding it for evaluation and post here if I get good success with it.Lexicologist

© 2022 - 2024 — McMap. All rights reserved.