0.2.0 • Published 5 months ago

@bufbuild/cel v0.2.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

@bufbuild/cel

This package provides a CEL evaluator for ECMAScript.

Example

Let's create a CEL environment, and define the variable name:

import { createEnv } from "@bufbuild/cel";
import { createRegistry } from "@bufbuild/protobuf";

const env = createEnv("", createRegistry());
env.set("name", "tacocat");

That's it. The environment is ready to be used for parsing and evaluation.

To parse and evaluate an expression, call run:

env.run(`
  name.startsWith('taco')
`); // true
0.2.0

5 months ago

0.1.0

6 months ago

0.0.1

6 months ago