MCPcopy Index your code
hub / github.com/callstack/agent-device / findProjectRoot

Function findProjectRoot

src/utils/version.ts:17–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15}
16
17export function findProjectRoot(): string {
18 const start = path.dirname(fileURLToPath(import.meta.url));
19 let current = start;
20 for (let i = 0; i < 6; i += 1) {
21 const pkgPath = path.join(current, 'package.json');
22 if (fs.existsSync(pkgPath)) return current;
23 current = path.dirname(current);
24 }
25 return start;
26}

Calls

no outgoing calls