是否有任何规则引擎在 NodeJS 上/在 Javascript 中实现?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9001750/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there any rules engine implemented on NodeJS / in Javascript?
提问by Samudra
I need a lightweight rules engine. We have around 50 rules right now, but the rules keep changing frequently.
我需要一个轻量级的规则引擎。我们现在有大约 50 条规则,但规则不断变化。
We could use Drools, but I figure that would be overkill. Are there any lighter, F/OSS implementations?
我们可以使用 Drools,但我认为这太过分了。有没有更轻量级的 F/OSS 实现?
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)
我知道另一个类似的问题,但那是 2 岁,没有很好的答案。(我没有足够的代表来评论这个问题)
回答by Cache
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).
我也晚了很多,但是由于您要求更轻松的选择,请考虑 json-rules-engine。我编写这个库是为了创建一个简单、高性能的规则引擎,具有简单的规则持久性(规则以 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.
它并不意味着作为企业解决方案,并且没有nools雄心勃勃。许多企业在规则引擎方面有相对基本的需求:布尔逻辑、比较运算符和(理想情况下)人类可读的规则。
Your use case of having only 50 rules that change often(i.e. highly configurable), is really the target audience for this library.
您只有 50 条经常更改的规则(即高度可配置)的用例确实是该库的目标受众。
回答by Johny Jose
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.
我制作了一个名为 node-clips 的新节点包,它允许您将流行的 CLIPS(C 语言集成生产系统)规则引擎集成到您的节点应用程序中。
https://github.com/atrniv/node-clips
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.
CLIPS 是一种高效的开发和交付专家系统工具,它为构建基于规则和/或对象的专家系统提供了一个完整的环境。CLIPS 创建于 1985 年,现已广泛应用于政府、工业和学术界。
Checkout the official CLIPS documentation for more information : http://clipsrules.sourceforge.net/
查看官方 CLIPS 文档了解更多信息:http: //clipsrules.sourceforge.net/
回答by Ivo Nascimento
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.
业务规则引擎是一种为支持规则在规则基础上变化的环境而开发的软件,如风险评估、文本分析、数据挖掘和其他旨在制定决策的软件。
回答by Fred Strauss
I'm obviously very late to the game here but I've used node-ruleswith some success.
我显然在这里玩游戏很晚,但我已经成功地使用了节点规则。
回答by enriched
I am even later to the game, but if people are still looking, durable_rulesis a great project that I have been using.
我进入游戏的时间更晚,但如果人们还在寻找,那么 Durable_rules是我一直在使用的一个很棒的项目。
durable_rules stores state in redis and uses a Rete algorithm that Jesus Ruiz cooked upto do inference in a distributed way. The project is actively supported and even has TypeScript support if you are into that sort of thing.
Durable_rules 将状态存储在 redis 中,并使用Jesus Ruiz编写的Rete 算法以分布式方式进行推理。该项目受到积极支持,如果您喜欢这种事情,甚至还支持 TypeScript。