MCPcopy Create free account
hub / github.com/angular/dev-infra / findPackageJsonFilesInDirectory

Function findPackageJsonFilesInDirectory

bazel/api-golden/find_entry_points.ts:98–107  ·  view source on GitHub ↗

Finds all `package.json` files within a directory.

(directoryPath: string)

Source from the content-addressed store, hash-verified

96
97/** Finds all `package.json` files within a directory. */
98function* findPackageJsonFilesInDirectory(directoryPath: string): IterableIterator<string> {
99 for (const fileName of readdirSync(directoryPath)) {
100 const fullPath = join(directoryPath, fileName);
101 if (isDirectory(fullPath)) {
102 yield* findPackageJsonFilesInDirectory(fullPath);
103 } else if (fileName === 'package.json') {
104 yield fullPath;
105 }
106 }
107}

Calls 1

isDirectoryFunction · 0.85

Tested by

no test coverage detected