A one-stop tool for building Rust-generated WebAssembly packages that interoperate with JavaScript in browsers or Node.js.
wasm-pack is a command-line tool that facilitates building, testing, and publishing Rust-generated WebAssembly packages for use with JavaScript. It solves the complexity of integrating Rust's performance benefits into web and Node.js applications by automating the workflow from Rust code to distributable Wasm modules. The tool ensures compatibility with npm and existing JavaScript tooling like webpack.
Rust developers looking to compile their code to WebAssembly for web or Node.js applications, and JavaScript developers seeking to incorporate high-performance Rust modules into their projects.
Developers choose wasm-pack for its streamlined, all-in-one approach to Rust-Wasm development, eliminating manual configuration and providing built-in support for testing, packaging, and publishing. Its focus on interoperability with JavaScript ecosystems makes it a practical choice for integrating Rust into modern web workflows.
📦✨ your favorite rust -> wasm workflow tool!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
From the README, wasm-pack offers commands for 'new', 'build', 'test', 'pack', and 'publish', covering the entire Rust-to-Wasm pipeline in a single tool without manual configuration.
It builds npm-compatible packages and integrates with existing JavaScript tooling like webpack, as highlighted in the description, bridging Rust's performance with web ecosystems.
The 'test' command runs browser-based tests to ensure compatibility, reducing the need for additional testing setup and catching issues early.
With 'pack' and 'publish' commands, it simplifies distributing Wasm modules to npm registries, facilitating sharing and deployment as standard JavaScript packages.
Requires Rust 1.30.0 or later, meaning developers must install and maintain the Rust ecosystem, which adds setup complexity and learning overhead for non-Rust users.
wasm-pack is specifically for Rust-generated WebAssembly, so it's not suitable for projects using other languages like C++ or Go for Wasm, locking users into Rust.
While Wasm offers speed, the integration layer and tooling can introduce build-time overhead and larger bundle sizes compared to pure JavaScript in some cases.