#web #wasm #devtools

app wasm-server-runner

cargo run for wasm programs

8 unstable releases (3 breaking)

0.4.0 Oct 27, 2022
0.3.0 Sep 2, 2022
0.2.4 Jun 1, 2022
0.2.3 May 12, 2022
0.1.0 Dec 10, 2021

#486 in WebAssembly

Download history 88/week @ 2022-11-26 74/week @ 2022-12-03 70/week @ 2022-12-10 95/week @ 2022-12-17 78/week @ 2022-12-24 103/week @ 2022-12-31 114/week @ 2023-01-07 135/week @ 2023-01-14 124/week @ 2023-01-21 132/week @ 2023-01-28 162/week @ 2023-02-04 135/week @ 2023-02-11 119/week @ 2023-02-18 86/week @ 2023-02-25 106/week @ 2023-03-04 96/week @ 2023-03-11

425 downloads per month
Used in bevy_spatial

MIT license

18KB
231 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
~779K SLoC