BUN-test/index.js
2025-01-05 00:30:17 +01:00

14 lines
279 B
JavaScript

import { dlopen, FFIType, suffix } from "bun:ffi";
const path = `./libfibonacci.so`;
const { symbols } = dlopen(path, {
fibonacci_gmp: {
args: [],
returns: FFIType.cstring,
},
});
const result = symbols.fibonacci_gmp();
console.log("Fibonacci(25000) =", result);