0.1.0 • Published 5 years ago

@mattmayo/hello-wasm v0.1.0

Weekly downloads
-
License
MIT/Apache-2.0
Repository
github
Last release
5 years ago

Web Assembly with Rust

Here lies an example of how to create a wasm (web assembly) module by compiling Rust code. It is based on the following set of tutorials from Mozilla, who is a major sponsor of wasm.

How to execute

  1. Clone this repo
  2. cd site/
  3. npm install
  4. npm run serve
  5. Use a modern browser to view http://localhost:8080/ (https://www.mozilla.org/en-US/firefox/new/)

How to compile the web site

  1. Install node
  2. cd site
  3. npm install
  4. npm run serve

How to compile the Rust module (this is a bit more involved)

  1. Install rust https://www.rust-lang.org/tools/install
  2. cargo install wasm-pack
  3. npm adduser to publish the rust module to npm (remember to update the package name in package json if you are publishing to your account)
  4. wasm-pack build --scope mynpmusername