wasm-bindgen

Rust-JavaScript interop toolchain that generates the glue code needed to compile Rust to WebAssembly and call it from JS

Tool
Cargo
v0.2.127
9,119stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
94/100Excellent
Development Activity100
Maintenance96
Community80
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
85/100Excellent
Architecture92
Code Quality90
Innovation90
Learning Curve68

wasm-bindgen is the foundational toolchain for making Rust and WebAssembly interoperate with JavaScript. Rather than requiring developers to hand-write low-level glue code that shuttles values across the Wasm/JS boundary, its #[wasm_bindgen] procedural macro annotates Rust functions, structs, and enums, and its companion CLI post-processes the compiled .wasm binary to emit matching JS/TypeScript bindings - exporting Rust APIs to JS and importing JS/Web APIs into Rust with full type fidelity for strings, closures, structs, and JS objects.

The project is a monorepo housing the whole ecosystem: the wasm-bindgen crate and macro, the wasm-bindgen-cli binary that generates bindings, wasm-bindgen-futures for bridging JS Promises with Rust async/await, and the js-sys/web-sys crates that expose typed bindings for JavaScript’s standard globals and the full Web API surface respectively. Together these are the substrate that nearly every Rust-to-Wasm web project (frameworks like Yew and Leptos included) builds on.

What You Get

  • The #[wasm_bindgen] procedural macro for exporting Rust functions/structs to JS and importing JS/Web APIs into Rust
  • wasm-bindgen-cli, a post-processing tool that rewrites the compiled .wasm binary and emits matching JS/TypeScript glue files
  • wasm-bindgen-futures for converting between JS Promises and Rust Futures, enabling async/await across the boundary
  • js-sys, providing raw bindings to JavaScript’s standard built-in objects (Array, Object, Promise, etc.)
  • web-sys, providing generated bindings to the full Web API surface (DOM, fetch, WebSockets, canvas, and hundreds more)

Common Use Cases

  • Shipping performance-critical Rust code (image processing, physics, parsers) into a web app as a WebAssembly module callable from JavaScript
  • Building Rust-based frontend frameworks (Yew, Leptos, Dioxus) that need to manipulate the DOM and call Web APIs directly from Rust
  • Wrapping an existing JS library or browser API so idiomatic, typed Rust code can call it without hand-written FFI shims
  • Bridging async JavaScript code (fetch, timers, Promise-based APIs) with Rust’s async/await via wasm-bindgen-futures

Under The Hood

Architecture - The repo is a Cargo workspace of tightly coupled crates: crates/macro and crates/macro-support implement the #[wasm_bindgen] attribute macro that annotates Rust items with metadata; src/describe.rs and src/convert in the core wasm-bindgen crate define how Rust types serialize across the ABI boundary; crates/cli-support and crates/cli implement the binary that parses the compiled .wasm module’s custom sections (written by the macro) and emits the final JS/TypeScript glue files. js-sys and web-sys are separately generated crates (from WebIDL definitions, see crates/webidl) that layer typed, ergonomic Rust bindings for JS globals and Web APIs on top of the same low-level wasm-bindgen runtime primitives (src/closure.rs, src/externref.rs). Tech Stack - Pure Rust (94.9% of the codebase) targeting the wasm32-unknown-unknown and related Wasm targets, with a small JS/TS runtime shim generated per-project; uses cfg-if, once_cell, optional serde/serde_json for the core crate, and a justfile/CI matrix that runs tests across headless browsers, Node, Deno, and no-std targets. Code Quality - The tests/ directory is unusually extensive, with dedicated suites for tests/wasm (browser-run integration tests), tests/headless (headless-browser CI), tests/worker, tests/no-std, and tests/wasm32-emscripten, reflecting the project’s need to validate behavior across many Wasm execution environments; 548 contributors and continuous CI (main.yml) indicate mature review and regression-testing discipline. API Design - The #[wasm_bindgen] macro keeps the common case declarative (annotate a function or struct and it’s exposed to JS with matching types), while js-sys/web-sys mirror JS/Web API naming closely enough that developers already familiar with the DOM or JS standard library can transfer that knowledge directly into Rust.

Used by 9 apps in this directory

TypeScript
75%
GPL 3.0

Bramble

Password Manager · Security · Authentication

315

Local-first, end-to-end encrypted password manager that syncs your vault directly between your own devices over a private peer-to-peer mesh — no server, no account, no cloud in the middle.

View details
73
Repo Health
84
Technical
72
Dependency
Built with
TypeScript75%
Updated today
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,437

A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.

View details
70
Repo Health
90
Technical
62
Dependency
Built with
Java34%
TypeScript27%
Scala26%
Updated 1 weeks ago
Rust
50%
Other

hoodik

File Storage · Security

1,446

Self-hosted, end-to-end encrypted cloud storage with browser-based encryption and S3-compatible storage support

View details
74
Repo Health
71
Technical
65
Dependency
Built with
Rust50%
TypeScript33%
Vue15%
Updated 4 days ago
TypeScript
97%
Other

Infisical

Security · Devops

28,838

The open-source platform for secrets, certificates, privileged access, and AI agent security — all in one self-hostable system.

View details
91
Repo Health
84
Technical
66
Dependency
Built with
TypeScript97%
Updated today
TypeScript
76%
Other

Joplin

Note Taking

56,003

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
62
Dependency
Built with
TypeScript76%
JavaScript15%
Updated yesterday
Rust
84%
Apache 2.0

liteparse

Developer Tools

12,123

A fast, lightweight, open-source document parser that extracts spatial text, bounding boxes, and Markdown from PDFs and Office files — entirely on your machine.

View details
83
Repo Health
80
Technical
74
Dependency
Built with
Rust84%
Updated today
Rust
92%
MIT

OpenPencil

AI Design Tools

5,380

An open-source, AI-native vector design tool with concurrent agent teams, design-as-code, a built-in MCP server, and multi-model intelligence — a distinct project from the similarly-named Figma-file-reading "open-pencil" editor.

View details
80
Repo Health
70
Technical
75
Dependency
Built with
Rust92%
Updated today
Rust
67%
Apache 2.0

Rivet

AI Agents · Developer Tools

6,065

Stateful actors as a primitive for AI agents, real-time collaboration, and durable execution — with in-memory state, WebSockets, queues, and scheduling built in.

View details
86
Repo Health
81
Technical
66
Dependency
Built with
Rust67%
TypeScript29%
Updated today
Python
61%
Apache 2.0

WrenAI

Analytics · AI Agents · Data Engineering

17,313

Open-source GenBI engine that lets AI agents turn natural-language questions into governed SQL, charts, and shareable dashboards across 20+ data sources — no vendor lock-in, no black-box prompts.

View details
91
Repo Health
91
Technical
69
Dependency
Built with
Python61%
Rust36%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search