feat: copied from github.com/seddonm1/quickjs
This commit is contained in:
57
README.md
57
README.md
@@ -1,3 +1,56 @@
|
||||
# seddonm1-quickjs
|
||||
This repository demonstrates how to use [quickjs-wasm-rs](https://github.com/Shopify/javy/tree/main/crates/quickjs-wasm-rs) with [wasmtime](https://github.com/bytecodealliance/wasmtime) to easily build a safe and isolated plugin system for Rust.
|
||||
|
||||
From: https://github.com/seddonm1/quickjs
|
||||
Code to accompany blog post: https://reorchestrate.com/posts/plugins-for-rust
|
||||
|
||||
First `build-wasm.sh` script which will download and build the `quickjs.wasm` module.
|
||||
|
||||
# Examples
|
||||
|
||||
Run a sequential executor:
|
||||
|
||||
```bash
|
||||
cargo run --example iter --release
|
||||
```
|
||||
|
||||
Run a parallel executor:
|
||||
|
||||
```bash
|
||||
cargo run --example par_iter --release
|
||||
```
|
||||
|
||||
Both accept additional arguments like:
|
||||
|
||||
```bash
|
||||
cargo run --release --example iter -- \
|
||||
--module ./quickjs.wasm \
|
||||
--script ./track_points.js \
|
||||
--data ./track_points.json \
|
||||
--iterations 1000 \
|
||||
--inherit-stdout \
|
||||
--inherit-stderr
|
||||
```
|
||||
|
||||
# Build
|
||||
|
||||
```bash
|
||||
cargo build --package quickjs --release
|
||||
```
|
||||
|
||||
# Test
|
||||
|
||||
```bash
|
||||
cargo test --package quickjs --release
|
||||
```
|
||||
|
||||
# Bench
|
||||
|
||||
```bash
|
||||
cargo bench --package quickjs
|
||||
```
|
||||
|
||||
# Credits
|
||||
|
||||
- Peter Malmgren https://github.com/pmalmgren/wasi-data-sharing
|
||||
- Shopify https://github.com/Shopify/javy
|
||||
- Bytecode Alliance https://github.com/bytecodealliance/wasmtime
|
||||
- Bytecode Alliance https://github.com/bytecodealliance/wizer
|
||||
|
||||
Reference in New Issue
Block a user