The name of the library or file path. This will be passed to dlopen()
Map of symbols to load where the key is the symbol name and the value is the FFIFunction
Open a library using "bun:ffi"
import {dlopen} from 'bun:ffi';
const lib = dlopen("duckdb.dylib", {
get_version: {
returns: "cstring",
args: [],
},
});
lib.symbols.get_version();
// "1.0.0"
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.
The name of the library or file path. This will be passed to dlopen()
Map of symbols to load where the key is the symbol name and the value is the FFIFunction
Generated using TypeDoc
Open a library using
"bun:ffi"
Example
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.