mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
13 lines
195 B
TypeScript
13 lines
195 B
TypeScript
import { dlopen, suffix } from "bun:ffi";
|
|
|
|
const {
|
|
symbols: { add },
|
|
} = dlopen(`./libadd.${suffix}`, {
|
|
add: {
|
|
args: ["i32", "i32"],
|
|
returns: "i32",
|
|
},
|
|
});
|
|
|
|
console.log(add(1, 2));
|