node-ctypes - v2.17.1
    Preparing search index...

    Function find_library

    • Resolve a library name to a platform-specific filename or path.

      Python equivalent: ctypes.util.find_library(name)

      • On Windows, as Python: the full path of the first match on PATH (bare names get .dll appended), and null for "c" / "m".
      • On Linux, the ldconfig cache and common library directories are searched for the best-matching libNAME.so.VERSION.
      • On macOS, the DYLD_* paths, the dyld fallback directories, Homebrew and the framework directories are searched, including the dyld shared cache (system libraries and frameworks are not on disk since macOS 11).

      Returns null when nothing is found (or the input is invalid), on every platform, as Python does: check the result before loading it.

      Parameters

      • name: string

      Returns string

      import { find_library, CDLL } from 'node-ctypes';
      const path = find_library('z');
      if (path !== null) {
      const libz = new CDLL(path);
      }