@pnpm/find-workspace-dir efficiently locates the root directory of a monorepo workspace. It traverses upwards from a given starting path, searching for a pnpm-workspace.yaml, workspace.yaml, or a package.json with a workspaces field, signaling the workspace root. This utility is crucial for tools needing to understand project structures within a monorepo, ensuring operations are performed from the correct context, like resolving local dependencies. It returns the absolute path to the workspace directory or undefined if no workspace is found.
The npm package @pnpm/find-workspace-dir has been actively maintained since its initial release in December 2019. Release frequency varied, with notable peaks in 2022 and 2024. While some months saw multiple releases, others had none. The package saw releases for versions 1.0.0 all the way up to 1000.1.2 as recent as July 2025.
@pnpm/find-workspace-dir downloads surged from March 2024 to a peak in February 2025 (2,537,554). Since then, downloads have generally decreased, with August 2025 reaching 1,134,688. September 2025 downloads are incomplete but show a further decrease.