#web #wasm #devtools

app wasm-server-runner

cargo run for wasm programs

7 releases

Uses new Rust 2021

0.3.0 Sep 2, 2022
0.2.4 Jun 1, 2022
0.2.3 May 12, 2022
0.2.2 Apr 10, 2022
0.1.0 Dec 10, 2021

#70 in WebAssembly

Download history 117/week @ 2022-06-05 73/week @ 2022-06-12 78/week @ 2022-06-19 60/week @ 2022-06-26 49/week @ 2022-07-03 71/week @ 2022-07-10 66/week @ 2022-07-17 77/week @ 2022-07-24 120/week @ 2022-07-31 91/week @ 2022-08-07 110/week @ 2022-08-14 116/week @ 2022-08-21 113/week @ 2022-08-28 106/week @ 2022-09-04 75/week @ 2022-09-11 85/week @ 2022-09-18

397 downloads per month

MIT license

17KB
227 lines

wasm-server-runner

Allows you to run programs in the browser using web assembly using a simple cargo run.

Usage

Step 1.

cargo install wasm-server-runner

Step 2.

Add this to your ~/.cargo/config.toml (not the Cargo.toml of your project!):

[target.wasm32-unknown-unknown]
runner = "wasm-server-runner"

Step 3.

Run programs in the browser using

cargo run --target wasm32-unknown-unknown
cargo run --target wasm32-unknown-unknown --example example

wasm-server-runner path/to/file.wasm

Example output:

INFO wasm_server_runner: wasm output is 49.79kb large
INFO wasm_server_runner::server: starting webserver at http://127.0.0.1:1334

The website will reload when the server is restarted and serve files relative to the current directory.

Dependencies

~36MB
~775K SLoC