Skip to content

Commit 1465990

Browse files
docs: readme
1 parent befeac9 commit 1465990

File tree

3 files changed

+45
-21
lines changed

3 files changed

+45
-21
lines changed

README.md

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,7 @@ await timeProgram.execute({
106106
}); // true
107107
```
108108

109-
> [!NOTE]
110-
>
111-
> Performance measurements on an Apple M3 Pro show that compiling a complex CEL
112-
> expression (with map/filter operations) takes about 1.4ms, while execution
113-
> takes about 0.7ms. The one-step `evaluate()` function takes roughly 2ms as it
114-
> performs both steps.
109+
> [!TIP]
115110
>
116111
> Consider pre-compiling expressions when:
117112
>
@@ -122,13 +117,19 @@ await timeProgram.execute({
122117
>
123118
> For one-off evaluations or when expressions change frequently, the convenience
124119
> 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.
125125
126126
## Architecture
127127

128128
This project consists of three main components:
129129

130-
1. **cel-rust**: The underlying Rust implementation of the CEL interpreter,
131-
created by clarkmcc. This provides the core CEL evaluation engine.
130+
1. [**cel-rust**][cel-rust]: The underlying Rust implementation of the CEL
131+
interpreter, created by clarkmcc. This provides the core CEL evaluation
132+
engine.
132133

133134
2. **NAPI-RS Bindings**: A thin Rust layer that bridges cel-rust with Node.js
134135
using [NAPI-RS](https://napi.rs/). NAPI-RS is a framework for building
@@ -161,18 +162,6 @@ The native module is built using NAPI-RS and provides cross-platform support:
161162
[loader]: ./libs/core/src/native.cjs
162163
[wrapper]: ./libs/core/src/index.ts
163164

164-
### Package Size
165-
166-
Packages are sized at no more than 3 MB unpacked.
167-
168-
> | Platform | Package |
169-
> | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
170-
> | macOS ARM64 (Apple Silicon) | [`@kevinmichaelchen/cel-typescript-darwin-arm64`](https://www.npmjs.com/package/@kevinmichaelchen/cel-typescript-darwin-arm64) |
171-
> | macOS x64 (Intel) | [`@kevinmichaelchen/cel-typescript-darwin-x64`](https://www.npmjs.com/package/@kevinmichaelchen/cel-typescript-darwin-x64) |
172-
> | Linux x64 | [`@kevinmichaelchen/cel-typescript-linux-x64-gnu`](https://www.npmjs.com/package/@kevinmichaelchen/cel-typescript-linux-x64-gnu) |
173-
> | Linux ARM64 | [`@kevinmichaelchen/cel-typescript-linux-arm64-gnu`](https://www.npmjs.com/package/@kevinmichaelchen/cel-typescript-linux-arm64-gnu) |
174-
> | Windows x64 | [`@kevinmichaelchen/cel-typescript-win32-x64-msvc`](https://www.npmjs.com/package/@kevinmichaelchen/cel-typescript-win32-x64-msvc) |
175-
176165
## Contributing
177166

178167
### cel-rust submodule

libs/core/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# `@kevinmichaelchen/cel-typescript-core`
2+
3+
[![npm version](https://img.shields.io/npm/v/@kevinmichaelchen/cel-typescript-core.svg)](https://www.npmjs.com/package/@kevinmichaelchen/cel-typescript-core)
4+
[![npm downloads](https://img.shields.io/npm/dm/@kevinmichaelchen/cel-typescript-core.svg)](https://www.npmjs.com/package/@kevinmichaelchen/cel-typescript-core)
5+
6+
TypeScript bindings for the [cel-rust] library.
7+
8+
> [Common Expression Language (CEL)][cel] is an expression language that’s fast,
9+
> portable, and safe to execute in performance-critical applications.
10+
11+
The bindings to Rust are powered by [napi-rs].
12+
13+
[cel]: https://cel.dev/
14+
[cel-rust]: https://github.com/clarkmcc/cel-rust
15+
[napi-rs]: https://github.com/napi-rs/napi-rs
16+
17+
This package automatically detects your platform and loads the appropriate
18+
native binary from one of the platform-specific packages (which you will also
19+
need to install):
20+
21+
- [`@kevinmichaelchen/cel-typescript-darwin-arm64`](https://www.npmjs.com/package/@kevinmichaelchen/cel-typescript-darwin-arm64) -
22+
macOS ARM64 (Apple Silicon)
23+
- [`@kevinmichaelchen/cel-typescript-darwin-x64`](https://www.npmjs.com/package/@kevinmichaelchen/cel-typescript-darwin-x64) -
24+
macOS x64 (Intel)
25+
- [`@kevinmichaelchen/cel-typescript-linux-x64-gnu`](https://www.npmjs.com/package/@kevinmichaelchen/cel-typescript-linux-x64-gnu) -
26+
Linux x64
27+
- [`@kevinmichaelchen/cel-typescript-linux-arm64-gnu`](https://www.npmjs.com/package/@kevinmichaelchen/cel-typescript-linux-arm64-gnu) -
28+
Linux ARM64
29+
- [`@kevinmichaelchen/cel-typescript-win32-x64-msvc`](https://www.npmjs.com/package/@kevinmichaelchen/cel-typescript-win32-x64-msvc) -
30+
Windows x64
31+
32+
## Documentation
33+
34+
For full documentation and usage examples, please refer to the
35+
[main repository](https://github.com/kevinmichaelchen/cel-typescript).

libs/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"url": "https://github.com/kevinmichaelchen/cel-typescript/issues"
1414
},
1515
"homepage": "https://github.com/kevinmichaelchen/cel-typescript#readme",
16-
"files": ["dist/src/**"],
16+
"files": ["dist/src/**", "README.md"],
1717
"keywords": [
1818
"cel",
1919
"common-expression-language",

0 commit comments

Comments
 (0)