Search code examples
javascriptnode.jsrule-engine

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


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)


Solution

  • 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.