MCPcopy Create free account
hub / github.com/TanStack/cli / findPackageJsonFiles

Function findPackageJsonFiles

scripts/check-outdated-packages.js:28–43  ·  view source on GitHub ↗

* Recursively find all package.json files in a directory

(dir, files = [])

Source from the content-addressed store, hash-verified

26 * Recursively find all package.json files in a directory
27 */
28function findPackageJsonFiles(dir, files = []) {
29 const items = readdirSync(dir)
30
31 for (const item of items) {
32 const fullPath = join(dir, item)
33 const stat = statSync(fullPath)
34
35 if (stat.isDirectory() && item !== 'node_modules' && item !== 'dist') {
36 findPackageJsonFiles(fullPath, files)
37 } else if (item === 'package.json') {
38 files.push(fullPath)
39 }
40 }
41
42 return files
43}
44
45// Cache for package versions to avoid duplicate API calls
46const versionCache = new Map()

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected