This directory contains standalone runnable examples demonstrating different features of the bun-ffi-structs library.
Run any example with Bun:
bun run examples/01-basic-primitives.tsRun all examples:
./examples/run-all.shThe native/ subdirectory contains a complete example of using bun-ffi-structs with actual native Zig code:
- Zig compiler installed
- Bun runtime
cd examples/native
./build.sh # Compile the Zig dynamic library
bun index.ts # Run the TypeScript example- Unpacking arrays of structs is not yet implemented (see examples 09, 10)
- Unpacking arrays of primitives is not yet implemented (see example 04)
- Unpacking object pointers returns the raw pointer value, not the reconstructed object