@alexaegis/workspace-tools
Version:
Tools for working with javascript workspaces
26 lines (25 loc) • 837 B
JavaScript
const require_get_workspace_root_function = require("./get-workspace-root.function-BKR-FeN5.cjs");
require("./get-root-package-json.function-DWdZuWlE.cjs");
//#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 require_get_workspace_root_function.collectFileDirnamePathsUpDirectoryTree(require_get_workspace_root_function.PACKAGE_JSON_NAME, {
cwd,
maxPackages: 1
})[0];
};
//#endregion
Object.defineProperty(exports, "getCurrentPackageRoot", {
enumerable: true,
get: function() {
return getCurrentPackageRoot;
}
});
//# sourceMappingURL=npm-B2FWU_xL.cjs.map