bun:ffi lets you efficiently call C functions & FFI functions from JavaScript
without writing bindings yourself.
import {dlopen, CString, ptr} from'bun:ffi';
constlib = dlopen('libsqlite3', { });
This is powered by just-in-time compiling C wrappers
that convert JavaScript types to C types and back. Internally,
bun uses tinycc, so a big thanks
goes to Fabrice Bellard and TinyCC maintainers for making this possible.
bun:ffi
lets you efficiently call C functions & FFI functions from JavaScript without writing bindings yourself.This is powered by just-in-time compiling C wrappers that convert JavaScript types to C types and back. Internally, bun uses tinycc, so a big thanks goes to Fabrice Bellard and TinyCC maintainers for making this possible.