| What it is | A framework for building compiled Node.js add-ons in Rust via Node-API | Generates Rust FFI bindings to C and some C++ libraries from their headers | Generates the glue between Rust WebAssembly modules and JavaScript | Call Rust code from Flutter and Dart, with the glue code generated for you |
| Features | - #[napi] macros generate JavaScript bindings and TypeScript definitions
- napi build: zero-config build of the add-on
- Cross-compilation for many platforms
- CI templates and per-platform npm packages
- WebAssembly target from the same code
- Lifetime-managed, safer API design
| - Generates repr(C) structs, extern functions, enums and constants from C headers
- Runs from build.rs as a build dependency, or from the command line with bindgen-cli
- Allowlisting, blocklisting, opaque and replaced types
- Control over derived traits such as Copy and Clone
- Extra clang arguments through environment variables, per target for cross-compiling
| - 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)
| - generates Dart bindings for ordinary Rust code
- arbitrary Rust types, closures, async functions and traits
- Rust can call Dart functions
- one-command project setup with flutter_rust_bridge_codegen create
- Android, iOS, Windows, Linux, macOS and web (JS and WebAssembly)
|