
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
@riddler/predicator
Advanced tools
Predicator is a safe (does not eval code), admin or business user facing predicate engine. It turns a string predicate like "score > 600 or (score > 580 and monthly_income > 9000)" along with a supplied context into a true or false. This predicate can be stored as an attribute of a model (ex: an Offer model could store a predicate indicating if it is available to a customer).
Simple usage:
const Predicator = require('predicator');
// Compile a list of instructions which a Predicator Evaluator can execute
Predicator.compile('score >= 600 or (score > 580 and income > 9000)');
// [
// [ 'load', 'score' ],
// [ 'to_int' ],
// [ 'lit', 600 ],
// [ 'compare', 'GTE' ],
// [ 'jtrue', 11 ],
// [ 'load', 'score' ],
// [ 'to_int' ],
// [ 'lit', 580 ],
// [ 'compare', 'GT' ],
// [ 'jfalse', 5 ],
// [ 'load', 'income' ],
// [ 'to_int' ],
// [ 'lit', 9000 ],
// [ 'compare', 'GT' ]
// ]
// Evaluation
Predicator.evaluate('score >= 600 or (score > 580 and income > 9000)', {score: 600}); // true
Predicator.evaluate('score >= 600 or (score > 580 and income > 9000)', {score: 590}); // false
Predicator.evaluate('score >= 600 or (score > 580 and income > 9000)', {score: 590, income: 10000}); // true
Bug reports and pull requests are welcome on GitHub at https://github.com/riddler/predicator-js. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The library is available as open source under the terms of the MIT License.
FAQs
Safe predicate engine
We found that @riddler/predicator 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
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.