The Wasmer Pack project is a code generator that takes in a WebAssembly library and the WAI files defining its interface, and generates packages for using it natively in your favourite programming language.
- The Wasmer Pack repository on GitHub (opens in a new tab)
- This user guide (opens in a new tab)
- The WebAssembly Package Manager (opens in a new tab)
*.waiformat (opens in a new tab)
The WAPM backend automatically runs Wasmer Pack over any packages that are published to the registry, so most users won't need to interact with it directly.
That said, the
wasmer-pack CLI is available on crates.io for those wanting to
run it locally (e.g. during testing).
$ cargo install wasmer-pack-cli
The same CLI is published to WAPM (opens in a new tab) as a WASI executable, meaning
you can use
wasmer run to automatically fetch and run the latest version.
$ wasmer run wasmer/wasmer-pack-cli --dir=. -- --help
-h, --help Print help information
-V, --version Print version information
help Print this message or the help of the given subcommand(s)
js Generate bindings for use with NodeJS
python Generate Python bindings
show Show metadata for the bindings that would be generated from a Pirita file
--dir=.flag is important! This tells the
wasmerCLI to let
wasmer/wasmer-pack-cliaccess the current directory.
WebAssembly is sandboxed by default, so all file system access must be explicitly provided.