@karmaniverous/get-dotenv
    Preparing search index...

    Function loadModuleDefault

    • Load a module default export from a JS/TS file with robust fallbacks.

      Behavior by extension:

      • .js/.mjs/.cjs: direct dynamic import.
      • .ts/.mts/.cts/.tsx:
        • try direct dynamic import (when a TS loader is active),
        • else compile via esbuild to a cached .mjs file and import,
        • else fallback to typescript.transpileModule for simple modules.

      Type Parameters

      • T

        Type of the expected default export.

      Parameters

      • absPath: string

        Absolute path to the source file.

      • cacheDirName: string

        Cache subfolder under .tsbuild/.

      Returns Promise<T | undefined>

      A Promise\<T | undefined\> resolving to the default export (if any).