Create your first WebAssembly npm package
A few months ago, wasm-pack entered into the scene with the promise of making really easy the process of creating
WebAssembly npm packages. And it works. But yet web developers who are not really familiar with all the Rust ecosystem have to deal with installing Rust, setting the proper toolchain, install the
That’s why I created wasm-pack-npm. To make all this dependency installation a breeze.
The only thing that you have to do is this:
npm i -g wasm-pack-npm
What you’ll get
The same will happen for wasm-pack.
At the moment of writing this post, wasm-pack will only work with
nightly toolchain so wasm-pack will set the
nightly toolchain as your default and then will install the wasm32-unknown-unknown target.
Finally, as a nice to have, it will install cargo-generate for you.
Once you have everything set up, just head to the wasm-pack documentation to learn more about how to proceed. In less than 1o minutes I bet you’ll have your first
WebAssembly npm package ready! :wink: