
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
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 5,167 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.