MCPcopy
hub / github.com/shareAI-lab/Kode-CLI / findPackageRoot

Function findPackageRoot

cli-acp.js:31–40  ·  view source on GitHub ↗
(startDir)

Source from the content-addressed store, hash-verified

29}
30
31function findPackageRoot(startDir) {
32 let dir = startDir
33 for (let i = 0; i < 25; i++) {
34 if (fs.existsSync(path.join(dir, 'package.json'))) return dir
35 const parent = path.dirname(dir)
36 if (parent === dir) break
37 dir = parent
38 }
39 return startDir
40}
41
42function readPackageJson(packageRoot) {
43 try {

Callers 1

mainFunction · 0.70

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected