Publishing to npm
Now that we have a working, fast, and small
wasm-game-of-life package, we
need an off-the-shelf Game of Life implementation.
Second, make sure you are logged into your account locally, by running this command:
Make sure that the
wasm-game-of-life/pkg build is up to date by running
wasm-pack inside the
Take a moment to check out the contents of
wasm-game-of-life/pkg now, this is
what we are publishing to npm in the next step!
When you're ready, run
wasm-pack publish to upload the package to npm:
That's all it takes to publish to npm!
...except other folks have also done this tutorial, and therefore the
wasm-game-of-life name is taken on npm, and that last command probably didn't
wasm-game-of-life/Cargo.toml and add your username to the end of the
name to disambiguate the package in a unique way:
[package] name = "wasm-game-of-life-my-username"
Then, rebuild and publish again:
wasm-pack init wasm-pack publish
This time it should work!