ffi.suffix


当前平台的本地共享库后缀:

🌐 The native shared library suffix for the current platform:

  • 'dylib' 在 macOS 上
  • 'so' 在类 Unix 平台上
  • 'dll' 在 Windows 上

这可以用来构建可移植的库路径:

🌐 This can be used to build portable library paths:

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

const path = `libsqlite3.${suffix}`;