11# cel-typescript
22
3- A TypeScript binding for the Common Expression Language (CEL) using
3+ A TypeScript binding for the [ Common Expression Language (CEL)] [ cel-spec ] using
44[ cel-rust] [ cel-rust ] . This project provides a Node.js native module that allows
55you to use CEL in your TypeScript/JavaScript projects.
66
7+ CEL is a familiar C/C++/Java/Python-like language for expressing boolean
8+ conditions, calculations, and variable substitutions. It's especially useful for
9+ policy enforcement, configuration validation, and business rule evaluation.
10+
711[ cel-spec ] : https://github.com/google/cel-spec
812[ cel-rust ] : https://github.com/clarkmcc/cel-rust
913
10- ## What is CEL?
11-
12- [ Common Expression Language (CEL)] [ cel-spec ] is an expression language created
13- by Google that implements common semantics for expression evaluation. It's a
14- simple language for expressing boolean conditions, calculations, and variable
15- substitutions. CEL is used in various Google products and open-source projects
16- for policy enforcement, configuration validation, and business rule evaluation.
17-
1814## Installation
1915
2016``` bash
@@ -117,25 +113,27 @@ await timeProgram.execute({
117113>
118114> For one-off evaluations or when expressions change frequently, the convenience
119115> of ` evaluate() ` likely outweighs the performance benefit of pre-compilation.
120- >
121- > Performance measurements on an Apple M3 Pro show that compiling a complex CEL
122- > expression (with map/filter operations) takes about 1.4ms, while execution
123- > takes about 0.7ms. The one-step ` evaluate() ` function takes roughly 2ms as it
124- > performs both steps.
125116
126- ## Alternatives
117+ ## FAQ
118+
119+ ### Is it performant?
120+
121+ Performance measurements on an Apple M3 Pro show that compiling a complex CEL
122+ expression (with map/filter operations) takes about 1.4ms, while execution takes
123+ about 0.7ms. The one-step ` evaluate() ` function takes roughly 2ms as it performs
124+ both steps.
125+
126+ ### Is it conformant / feature-complete?
127127
128128The underlying ` cel-rust ` library — and, by extension, this library — is more
129129feature-complete than all of its peers in the JS/TS ecosystem here.
130130
131- > [ !NOTE]
132- >
133- > See the [ cel-js-evaluation] [ cel-js-evaluation ] repository for a comparison of
134- > the features provided by this library and its peers.
131+ See the [ cel-js-evaluation] [ cel-js-evaluation ] repository for a comparison of
132+ the features provided by this library versus its peers.
135133
136134[ cel-js-evaluation ] : https://github.com/kevinmichaelchen/cel-js-evaluation
137135
138- ## Architecture
136+ ### What does the architecture look like?
139137
140138This project consists of three main components:
141139
@@ -144,8 +142,8 @@ This project consists of three main components:
144142 engine.
145143
1461442 . ** NAPI-RS Bindings** : A thin Rust layer that bridges cel-rust with Node.js
147- using [ NAPI-RS] ( https:// napi.rs/ ) . NAPI-RS is a framework for building
148- pre-compiled Node.js addons in Rust, providing:
145+ using [ NAPI-RS] [ napi ] . NAPI-RS is a framework for building pre-compiled
146+ Node.js addons in Rust, providing:
149147
150148 - Type-safe bindings between Rust and Node.js
151149 - Cross-platform compilation support
@@ -159,7 +157,9 @@ This project consists of three main components:
159157>
160158> Only ESM is supported by this package.
161159
162- ### Native Module Structure
160+ ### How does NAPI work?
161+
162+ [ napi ] : https://napi.rs/
163163
164164The native module is built using NAPI-RS and provides cross-platform support:
165165
0 commit comments