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

Function findPackageRoot

cli.js:32–41  ·  view source on GitHub ↗
(startDir)

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected