mirror of
https://github.com/mii443/wasmer.git
synced 2025-09-02 15:39:32 +00:00
* Change PackageId to support both named and unnamed package * Update the package resolver logic with unnamed package support * Update the "package download" command
wasmer-cli

This crate is the Wasmer CLI.
The recommended way to install wasmer
is via the wasmer-installer.
However, you can also install wasmer
via Cargo (you will need to specify the compilers to use):
cargo install wasmer-cli --features "singlepass,cranelift"
Or by building it inside the codebase:
cargo build --release --features "singlepass,cranelift"
Features
The Wasmer supports the following features:
wat
(default): support for executing WebAssembly text files.wast
(default): support for running wast test files.cache
(default): support or automatically caching compiled artifacts.wasi
(default): support for WASI.emscripten
(default): support for Emscripten.singlepass
: support for the Singlepass compiler.cranelift
: support for the Cranelift compiler.llvm
: support for the LLVM compiler.
CLI commands
Once you have Wasmer installed, you can start executing WebAssembly files easily:
Get the current Wasmer version:
wasmer -V
Execute a WebAssembly file:
wasmer run myfile.wasm
Compile a WebAssembly file:
wasmer compile myfile.wasm -o myfile.wasmu
Run a compiled WebAssembly file (fastest):
wasmer run myfile.wasmu