new DynamicLibrary(path)


  • path <string> | <null> 动态库的路径,或使用 null 从当前进程镜像解析符号。

加载动态库而不急于解析任何函数。

🌐 Loads the dynamic library without resolving any functions eagerly.

在 Windows 上不支持传递 null

🌐 On Windows passing null is not supported.

const { DynamicLibrary } = require('node:ffi');

const lib = new DynamicLibrary('./mylib.so');