wasm-pack CLI
The CLI builds Rust into WebAssembly and prepares a JavaScript package for agent-assisted integration of a reviewed module.
- 7,300 ★ on the repository
- Last commit
- Apache-2.0
Extended access
Why this level
- During builds and tests, wasm-pack runs project and dependency code and creates files; a separate command lets the user publish to a registry.
Install
The author does not provide a one-line install. Open the repository and follow the README.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- During builds and tests, wasm-pack runs project and dependency code and creates files; a separate command lets the user publish to a registry.
This is third-party code. Review the repository files before installing.
What it does
Browsers, bundlers and Node.js load modules differently. Users select a target in wasm-pack, and an agent prepares the Rust build for that environment. WebAssembly output comes with JavaScript bindings and package metadata to inspect before integrating it into an app. Separate commands create projects from templates, run tests and package results. Tests use a separately selected runtime. Packaging creates a tarball for handoff; uploading it to a registry is a separate step.
Who it is for. Rust module authors building and testing WebAssembly for JavaScript through an agent and CLI.
Good fit when
- A web app needs to call a Rust function through JavaScript.
- One module is being packaged separately for a browser and Node.js.
- Before release, a developer runs tests in the target environment.
- A package is ready for handoff, but registry publication is not yet approved.
Not a fit when
- You expect automatic conversion of an arbitrary application into Rust.
- The project lacks an appropriate Rust crate and Cargo.toml.
- Registry publishing is unauthorized but a publishing step is selected.
Example request
Prepare a Rust-module build for Node.js, show generated files and a test plan without publishing the package.Limitations
Building requires compatible Rust and Cargo tools; installing wasm-pack does not configure the source Rust project for you. The target determines JavaScript bindings, so bundler output is not automatically suitable for every browser setup. Test environments must be selected to match the intended runtime. Packaging and publication are separate actions; inspect package contents and the registry identity before uploading.
How to disable. Stop builds or tests and remove wasm-pack calls from project scripts. Generated files and published packages remain until separately handled.
FAQ
What does a build produce?
A pkg directory with WebAssembly, JavaScript bindings and package metadata.
Does building publish the package?
No. Publishing is a separate command.
Can I target Node.js?
Yes. Run `wasm-pack build --target nodejs` in the directory containing `Cargo.toml` to generate Node.js bindings.
How do I see testing options?
Run `wasm-pack test --help`.
How do I enable build logging?
The README example is `RUST_LOG=info wasm-pack build`.
Discussion
No questions or reviews yet.
Related
CLI toolsPake CLI packages a website or local web build as a desktop app with a chosen name, icon and window configuration.
A Rust binary that doubles as an MCP server: complexity, tech debt, dead code and repository context for Claude Code and Cline.
A method pack that makes coding agents architecture-aware: baseline first, evidence checks, drift control and safety across long tasks
A Rust coding agent with a native GUI, a terminal mode, an ACP mode for Zed and an MCP server
rust-analyzer MCP: Rust code navigation for agents
r3bl-rust-analyzer-mcp-server
A Rust MCP server on standard threads: the agent gets hover info, go to definition, references, formatting and compiler diagnostics from rust-analyzer
Additional Cargo commands update dependency requirements and package versions, with dry-run previews for agent review.
README in short
The CLI separates project creation, builds, tests, packaging and publication. Check the chosen release’s requirements in its installation guidance.