wasm-bindgen is a Rust library and CLI toolchain that facilitates high-level interoperability between Rust-generated WebAssembly modules and JavaScript. It provides a `#[wasm_bindgen]` procedural macro to import JS functions and export Rust functions/structs/enums to JS, along with a post-processing CLI (`wasm-bindgen`) that generates JavaScript and TypeScript glue code for multiple targets (bundler, web, Node.js, Deno, no-modules). The repository also includes runtime crates (`js-sys`, `web-sys`, `wasm-bindgen-futures`, `wasm-bindgen-test`) that offer comprehensive bindings to standard JavaScript APIs and browser Web APIs, generated from WebIDL definitions. The project is the de facto standard for Rust-to-Wasm development, with extensive examples, benchmarks, and a robust test suite covering browser, Node, Deno, and headless environments.
This is a high-performance SVG rendering library for Node.js, Deno, Bun, and browsers, powered by the Rust `resvg` engine. It converts SVG to PNG/AVIF with support for cropping, scaling, background colors, custom fonts (including WOFF2), bounding box extraction, and simplified SVG output. The library is implemented as a native addon via `napi-rs` for optimal speed on server-side runtimes, and also ships a WebAssembly build for browsers and edge environments. The codebase is well-structured, with clean separation between Rust core (rendering, option handling, font management) and JavaScript/TypeScript bindings. It includes comprehensive test suites, cross-platform CI/CD with prebuilt binaries for 18+ platforms, and thorough examples. The architecture demonstrates high craftsmanship in memory management (ObjectFinalize), error handling (panic catching), and pattern reuse (shared crop logic between NAPI and WASM).