A template for kick starting a Cloudflare worker project using
wasm-pack
.
This template is designed for compiling Rust libraries into WebAssembly and publishing the resulting worker to Cloudflare's worker infrastructure.
wasm-bindgen
for communicating between WebAssembly and JavaScript.console_error_panic_hook
for logging panic messages to the developer console.wee_alloc
, an allocator optimized for small code size.
Learn more about cargo generate
here.
cargo generate --git https://github.com/ashleygwilliams/rustwasm-worker-template.git --name wasm-worker
cd wasm-worker
wasm-pack build
wasm-pack test --headless --firefox