# wasm-bindgen

> Generates the glue between Rust WebAssembly modules and JavaScript

Source: https://talira.ai/catalog/wasm-bindgen-r2y6dgby
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library, Command-line tool
- Categories: [developer tools / language bindings](https://talira.ai/categories/developer-tools/language-bindings), [languages / rust](https://talira.ai/categories/languages/rust)
- Licence: MIT OR Apache-2.0[^3][^4]
- Pricing: Free and open source[^3]
- Free tier: yes[^3]
- Backed by: [wasm-bindgen](https://talira.ai/orgs/wasm-bindgen.md)

wasm-bindgen lets Rust compiled to WebAssembly call JavaScript and the browser's APIs, and lets JavaScript call exported Rust functions and types. A #[wasm_bindgen] attribute marks what to import and export, and wasm-bindgen-cli generates the JavaScript glue and an ES module for the .wasm file, including only the bindings you use. Companion crates give typed bindings to JavaScript's built-ins (js-sys) and to Web APIs such as the DOM (web-sys), bridge Rust futures and JavaScript promises (wasm-bindgen-futures), and run tests in browsers or Node.js (wasm-bindgen-test).

## Links

- Website: https://wasm-bindgen.github.io/wasm-bindgen/
- GitHub: https://github.com/wasm-bindgen/wasm-bindgen
- Docs: https://docs.rs/wasm-bindgen

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/wasm-bindgen>[^1]

## Problems it solves

- call the DOM from Rust compiled to WebAssembly
- export a Rust function so my JavaScript app can import it from a .wasm file
- run Rust code in the browser and talk to JavaScript

## Features

- Import JavaScript functions and export Rust functions and types with #[wasm_bindgen]
- Generates JavaScript glue and an ES module, only for the bindings you use
- Typed bindings to JavaScript built-ins (js-sys) and Web APIs (web-sys)
- Rust futures and JavaScript promises interoperate (wasm-bindgen-futures)
- Tests in headless browsers and Node.js (wasm-bindgen-test)

## Limitations

- The CLI needs a newer Rust (1.86) than the libraries (1.81), and the minimum can change in patch releases[^2]

## Trust

Overall: 0.71 out of 1.
Signals: maintenance 1.00, adoption 0.79, momentum 0.59, community 1.00, backing 0.30, extensibility 0.00.

- last commit 3 days ago
- 112 commits in the last 90 days
- latest release 0.2.130 31 days ago
- 9.2k GitHub stars
- 581 contributors
- accepts sponsorship (Github)
- 65 Homebrew installs in 30 days
- has a company behind it

## Alternatives

- [napi-rs](https://talira.ai/catalog/napi-rs-ka76jrjv.md): A framework for building compiled Node.js add-ons in Rust via Node-API

## Sources

[^1]: https://formulae.brew.sh/formula/wasm-bindgen (checked 28 Nov 2026)
[^2]: https://github.com/wasm-bindgen/wasm-bindgen (checked 28 Nov 2026)
[^3]: https://github.com/wasm-bindgen/wasm-bindgen/blob/main/LICENSE-MIT (checked 28 Nov 2026)
[^4]: https://github.com/wasm-bindgen/wasm-bindgen/blob/main/LICENSE-APACHE (checked 28 Nov 2026)
