Publishing your Package
Let's say you have a WebAssembly application, and you would like to publish it to WAPM so more people can use it easily.
You might have a similar project structure:
Now, in the root of your project, you can simply run
And it will guide you the process of creating a new wapm.toml
file for your project. At the end, it should have generated a manifest like the following:
Now, you will need to:
Creating an account in WAPM
Creating an account in WAPM is very easy, just go to the following url and sign up!
Login from the wapm CLI into your local account
Now that you are registered, you can just run the following command and it will ask for your credentials
Publish the package to WAPM
Now that you have successfully created a wapm.toml
manifest file for your project and have logged in into WAPM, you just need to run one more command!
And you package should now be live in wapm.io đ
All packages on wapm.io are namespaced by username.
If your program is a WASI program, it will be automatically available in the WebAssembly shell
Commands
Commands (not to be confused with wapm-cli subcommands) are a feature that enables easily executing Wasm code from a WAPM package.
Commands are what allows one to call the run
subcommand, like above when running wapm run cowsay hello wapm!
.
A command requires a name and module to reference:
Now called wapm run my_cmd
will execute the module defined with the name my_program_wasi
. Under the hood, wapm
calls wasmer
, the WebAssembly server runtime.
If you want to learn more about the manifest format, please jump into the next article!
Last updated