fast-fs-hash - v0.0.0-rc4
    Preparing search index...

    Function findProjectRoot

    • Walk the parent chain from startPath and locate project markers: .git, package.json, tsconfig.json, and node_modules/. For each marker the result contains nearest* (first hit walking up) and root* (last hit, bounded by the enclosing .git). Also reports gitRoot (innermost, matching git rev-parse --show-toplevel) and gitSuperRoot (outermost .git directory when nested in a submodule or worktree, otherwise null).

      The walk stops at the filesystem root, at the user's home directory (or any ancestor of it), at stopPath (same rule — if provided), and at a depth cap of 128 (symlink-loop defense).

      Tolerant of missing paths and mid-walk stat errors — missing fields are returned as null rather than throwing. If startPath doesn't exist, the walk begins from its longest existing ancestor.

      Runs asynchronously on the compute thread pool.

      Parameters

      • startPath: string

        Starting path — may be a file or a directory.

      • OptionalstopPath: string

        Optional directory — if the walker reaches this path (or any strict ancestor of it), the walk stops without probing.

      Returns Promise<ProjectRoot>