Innermost directory containing a .git (directory OR file). Matches git rev-parse --show-toplevel.
Outermost directory containing a .git directory. null when not inside a submodule/worktree.
First node_modules/ directory encountered walking up.
First package.json encountered walking up from the start path.
First tsconfig.json encountered walking up from the start path.
The canonical lockfile next to rootPackageJson, or null if
none exists. Picks whichever of pnpm-lock.yaml, yarn.lock, or
package-lock.json has the most recent mtime — the active package
manager rewrites its lockfile on every install, so stale lockfiles
left behind from a tool switch are passed over naturally. Ties on
mtime resolve in the order pnpm > yarn > npm. Bun's bun.lockb is
intentionally not included.
Last node_modules/ walking up, bounded by gitRoot.
Last package.json walking up, bounded by gitRoot (does not cross into a superproject).
Last tsconfig.json walking up, bounded by gitRoot.
Result of findProjectRoot / findProjectRootSync.
Every field is independently populated as the walker climbs the parent chain from the start path. A field is
nullwhen its marker was not found before the walk hit a stop boundary (filesystem root, user home, enclosing.git, or the depth cap of 128).