wasm-pack builds Rust WebAssembly packages for JavaScript in browsers or Node and can publish npm-compatible artifacts.
Overview
wasm-pack is a command-line workflow tool for Rust code compiled to WebAssembly that needs to interoperate with JavaScript. It targets both in-browser use and Node.js, and is positioned as a single place to assemble packages you can publish to npm or plug into existing JavaScript toolchains such as webpack.
Documented commands include generating a new RustWasm project from a template, building an npm-oriented wasm package from a crate, running browser tests, and creating tarballs or publishing to a registry. The tool expects a Rust toolchain and is oriented around the rust-wasm ecosystem rather than general-purpose application packaging.
Logging is configurable through the RUST_LOG environment variable when wasm-pack runs. For teams choosing how to ship Rust-derived WASM to front-end or Node consumers, wasm-pack concentrates scaffolding, build output layout, and registry-oriented packaging in one CLI instead of ad hoc scripts.
It is developer tooling installed locally; it does not deploy as network-facing server software on its own.
Key features
- Scaffold new RustWasm projects
- Build npm wasm packages from crates
- Browser test runner integration
- Pack and publish to registries
- JavaScript and Node interop focus
- Configurable logging via RUST_LOG
Use cases
- Publishing Rust WASM to npm
- Browser JavaScript interop
- Node.js WebAssembly modules
- Webpack-oriented WASM builds