Rust to WASM random number generator
Get a working rust toolchain. The easiest way is to use rustup and run
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Also need to install wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
You'll also need a working copy of node/npm (we're using 16.x/8.x).
Run
wasm-pack build
This may take a long time the first time, and will require internet access as it downloads crates.
This will produce a bunch of things, among them pkg
which holds the js package with typescript definitions, wrapper javascript and the wasm itself.
Following from the setup in the rustwasm book there's a small example project that uses this package in www
; from within that directory run:
npm install
npm run start
then navigate to https://localhost:8080
MIT © Imperial College of Science, Technology and Medicine
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.