UNPKG

@alexaegis/workspace-tools

Version:

Tools for working with javascript workspaces

21 lines (20 loc) 695 B
import { a as PACKAGE_JSON_NAME, n as collectFileDirnamePathsUpDirectoryTree } from "./get-workspace-root.function-DnORClbN.js"; import "./get-root-package-json.function-CFklF0V2.js"; //#region src/npm/get-current-package-root.function.ts /** * Returns the nearest folder where a package.json file is present * * (If you're searching for the farthest, use the getCurrentPackageRoot function) * * @param cwd @default process.cwd() * @returns */ var getCurrentPackageRoot = (cwd = process.cwd()) => { return collectFileDirnamePathsUpDirectoryTree(PACKAGE_JSON_NAME, { cwd, maxPackages: 1 })[0]; }; //#endregion export { getCurrentPackageRoot as t }; //# sourceMappingURL=npm-CqgJ7Snd.js.map