537d64a1b075ba90850a69482b825d962c8e6c3b
To build and use this:
1. Install wasm-pack (if you haven't already):
```bash
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
```
2. Build the WASM module:
```bash
wasm-pack build --target web --out-dir pkg
```
3. Serve the HTML file using a local HTTP server (required for ES modules):
```bash
python3 -m http.server 8000
# or
npx serve .
```
4. Use the API:
```js
// Method 1: Get structured result
const result = evaluate_cel("name + ' is ' + string(age)", {name: "Alice", age: 30});
console.log(result.success, result.result, result.error);
// Method 2: Get string result or error
try {
const result = evaluate_cel_string("name + ' is ' + string(age)", {name: "Alice", age: 30});
console.log(result);
} catch (error) {
console.error(error);
}
```
Description
0.2.0
Latest
Languages
Rust
52.8%
HTML
47.2%