Axinom Mosaic Libraries
    Preparing search index...

    Function getDbCommonBeforeMigrationPath

    • Resolves the absolute path to this package's migrations/before-migration directory from a caller module location.

      This helper remains useful when the caller needs to pass the path to another API explicitly. getBeforeMigrationScripts can resolve the same path internally in both CJS and ESM runtimes when the second argument is omitted.

      Pass import.meta.url from the calling ESM module. Internally uses createRequire to locate the installed package root via CJS resolution, which works correctly from both ESM and CJS contexts.

      Parameters

      • callerUrl: string

        The import.meta.url of the calling ESM module (or pathToFileURL(__filename).href from a CJS module when the caller wants to resolve this package's asset path explicitly).

      Returns string

      import { getBeforeMigrationScripts, getDbCommonBeforeMigrationPath } from '@axinom/mosaic-db-common';

      await getBeforeMigrationScripts(
      migrationsFolder,
      getDbCommonBeforeMigrationPath(import.meta.url),
      );