Rust WebAssembly Examples.

Prepares

$ curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

Steps

$ cargo generate --git https://github.com/rustwasm/wasm-pack-template
$ cd wasm-game-of-life
$ wasm-pack build

$ npm init wasm-app www
$ cd www

change package.json

{
  // ...
  "dependencies": {                     // Add this three lines block!
    "wasm-game-of-life": "file:../pkg"
  },
  "devDependencies": {
    //...
  }
}

continue

# you need install again after modify the package json file
$ npm install

$ npm start