Skip to content

Latest commit

 

History

History
49 lines (30 loc) · 1.45 KB

File metadata and controls

49 lines (30 loc) · 1.45 KB

The Buf logo

CEL-ES

License NPM Version NPM Version

An implementation of Common Expression Language (CEL) for ECMAScript.

Example

Let's evaluate a CEL expression that has the variable name and uses the strings extension functions:

import { run } from "@bufbuild/cel";
import { strings } from "@bufbuild/cel/ext";

run(
  `name.indexOf('taco') == 0`,
  {name: "tacocat"},
  {funcs: strings },
); // true

That's it!

For an example of creating resusable evaluator and more, refer to the example.ts.

Packages

Status: Beta

This project is in beta.

Legal

Offered under the Apache 2 license.