
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
cel-js is a powerful and efficient parser and evaluator for Google's Common Expression Language (CEL), built on the robust foundation of the Chevrotain parsing library. This library aims to provide a seamless and easy-to-use interface for working with CEL in JavaScript environments.
Try out cel-js in your browser with the live demo.
condition ? true : false)&&)||)==, !=)<, <=, >, >=, in)+, -, *, /, %)foo.bar)foo["bar"])has, size, etc.)
e.all(x, p))e.exists(x, p))e.exists_one(x, p))e.filter(x, p))has(foo.bar))e.map(x, t) and e.map(x, p, t))size(foo))!true, -123)myFunction())// This is a comment)To install cel-js, use npm:
npm i cel-js
evaluateevaluate is the primary function for parsing and evaluating CEL expressions. It takes an expression string and an optional object of variables to use in the expression.
import { evaluate, parse } from 'cel-js'
// use `evaluate` to parse and evaluate an expression
evaluate('2 + 2 * 2') // => 6
evaluate('"foo" + "bar"') // => 'foobar'
evaluate('user.role == "admin"', { user: { role: 'admin' } }) // => true
parseparse is a lower-level function that only parses an expression string into an AST. This can be useful if you want to evaluate the expression multiple times with different variables or if you want to validate the syntax of an expression.
// use `parse` to parse an expression, useful for validation purposes
const result = parse('2 + a')
if (!result.isSuccess) {
// your business logic
}
// you can reuse the result of `parse` to evaluate the expression
evaluate(result.cst, { a: 2 }) // => 4
evaluate(result.cst, { a: 4 }) // => 6
FAQs
Common Expression Language (CEL) evaluator for JavaScript
The npm package cel-js receives a total of 29,833 weekly downloads. As such, cel-js popularity was classified as popular.
We found that cel-js demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.