mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
8 lines
240 B
JavaScript
8 lines
240 B
JavaScript
/* example of JS module importing a C module */
|
|
import * as os from "os";
|
|
|
|
const isWin = os.platform === 'win32';
|
|
const { fib } = await import(`./fib.${isWin ? 'dll' : 'so'}`);
|
|
|
|
console.log("Hello World");
|
|
console.log("fib(10)=", fib(10));
|