Finds all `package.json` files within a directory.
(directoryPath: string)
| 96 | |
| 97 | /** Finds all `package.json` files within a directory. */ |
| 98 | function* 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 | } |
no test coverage detected