mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
* Instructions for WASM/JS binding Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com> * Document Python, WASM/JS bindings Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com> --------- Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
35 lines
577 B
Markdown
35 lines
577 B
Markdown
|
|
- Install `wasm-pack`
|
|
```
|
|
cargo install wasm-pack
|
|
```
|
|
|
|
- Build `regorusjs` for nodejs.
|
|
```
|
|
cd bindings/wasm
|
|
wasm-pack build --target nodejs --release
|
|
```
|
|
|
|
- Install [nodejs](https://nodejs.org/en/download)
|
|
|
|
- Run the test script
|
|
```
|
|
$ node test.js
|
|
\\{
|
|
\\ "result": [
|
|
\\ {
|
|
\\ "expressions": [
|
|
\\ {
|
|
\\ "value": "Hello, World!",
|
|
\\ "text": "data.test.message",
|
|
\\ "location": {
|
|
\\ "row": 1,
|
|
\\ "col": 1
|
|
\\ }
|
|
\\ }
|
|
\\ ]
|
|
\\ }
|
|
\\ ]
|
|
\\}
|
|
```
|