A sample project demonstrating integration between Rust and JavaScript using FFI (Foreign Function Interface) with the Bun runtime.
- 🇧🇷 Procurando algo em Português? Veja este README.
This project shows how to:
- 🦀 Use Rust code in JavaScript
- ⚡ Leverage Bun's power for FFI
- 🔧 Compile native libraries
- 🧪 Test the integration
bun install
Command | Description |
---|---|
bun dev |
🔄 Updates dependencies and runs tests |
bun build-rs |
🦀 Compiles Rust code |
bun up |
🏗️ Executes complete build (Rust + JS) |
- Clone the repository
- Install dependencies:
bun install
- Run complete build:
bun up
- For development:
bun dev
📦 bun-ffi
┣ 📂 rust # Rust code
┣ 📂 src # TypeScript code
┣ 📂 dist # Compiled files
┗ 📜 bun_build.js # Build script
Feel free to open issues and pull requests!
⭐ If this project was helpful to you, consider giving it a star!