bananass
Version:
Baekjoon Framework for JavaScript.🍌
14 lines (13 loc) • 655 B
TypeScript
/**
* Find root directory path based on the existence of `package.json`.
*
* This function uses `package.json` as a marker to determine the root directory,
* which is particularly useful in supporting MONOREPO structures.
* It first checks the current working directory using `process.cwd()`
* and then falls back to the Git root directory if necessary.
*
* @returns {string} The root directory path where `package.json` is found.
* @throws {Error} If `package.json` cannot be found in either the current
* working directory or the Git root directory, or if Git is not installed or accessible.
*/
export default function findRootDir(): string;