Skip to content

@tsdrivers/mssql / resolveLibraryPath

Function: resolveLibraryPath()

resolveLibraryPath(ctx): string

Defined in: projects/ts-mssql/core/binary.ts:55

Resolve the path to the native library. Throws if not found.

Resolution order:

  1. TSDRIVERS_MSSQL_LIB_PATH env var (explicit path)
  2. node_modules/pkg/native/{filename} (Node/Bun postinstall)
  3. Walk up from cwd — at each dir check: {dir}/{filename}, {dir}/lib/, {dir}/.lib/, {dir}/bin/, {dir}/.bin/
  4. Next to entry point
  5. Home directory: ~/lib/, ~/.lib/, ~/bin/, ~/.bin/
  6. ~/.cache/@tsdrivers/mssql/{version}/{filename}
  7. Throw with install instructions

Parameters

ctx

ResolutionContext

Returns

string