Here’s a (rare) working example for WASM on Firebase Cloud Function (NodeJS) with wasm-bindgen. It should be a good starter for ordinary NodeJS target too.

WASM on Firebase Cloud Function



# Setup Firebase
npm install -g firebase-tools
firebase init
firebase login
# Setup Rust
curl --proto '=https' --tlsv1.2 -sSf | sh
# Setup Cargo
cargo install cargo-watch
# Setup WASM
cargo install -f wasm-bindgen-cli


# To watch and build WASM from Rust
cd wasm
cargo watch -- . ./
# To run WASM with Firebase
cd functions
npm run dev


And yes! I’m now in love withRust and WebAssembly So much fun! :)