
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
rule-machine
Advanced tools
Rules Engine for Node.JS
Using npm:
$ npm install rule-machine
The following are some basic examples:
var rm = require('./rule-machine.js');
var rule = new rm({
onlyNewFire : true // Fired only new events (default: true)
});
rule.on('FIRE',function(fired){ //Name of fired rule
console.log(fired);
});
f = [
{'id':6,'val':60},
{'id':7,'val':70},
{'id':8,'val':80}
];
rule.addFact(f, false); // Add array of facts. And NOT check rules after add
rul =[
{
name: 'Test1',
when:[
'and',
{id:1, val:{$gte:10}},
{id:3, val:30}
],
callback: function(name){console.log('Callback for rule '+ name);}
},{
name: 'Test2',
when:[
'and',
{id:2, val:{$gt:20}}
]
},{
name: 'Test3',
when:[
'or',
{id:4, val:{$lt:10}},
{id:5, lastVal: {$gte:50} }
]
}
];
rule.addRule(rul); // Add array of rules
// add other facts
rule.addFact({'id':1,'val':10}, true); // add fact and check rules after add
rule.addFact({'id':2,'val':2}); // it same
rule.addFact({'id':3,'val':30});
rule.addFact({'id':4,'val':40});
rule.addFact({'id':5,'val':50}, false); // add fact and NOT check rules after add
rule.modFact({'val':125}, {'id':2}); // modify fact where id=2 and set val=125
rule.modFact({'lastVal':60}, {'id':5}); //modify fact where id=5 and add new property lastVal=60
FAQs
Rules Engine for Node.JS
We found that rule-machine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.