📜  fs.readfilesync withFileTypes true - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:53.539000             🧑  作者: Mango

代码示例2
_(fs.readdirSync(baseDir, {withFileTypes: true}))
  .filter(dirent => dirent.isDirectory())
  .map(dirent => dirent.name)
  .concat('.')
  .map(directory => path.resolve(baseDir, directory, '.platform.app.yaml'))
  .filter(file => fs.existsSync(file))
  .map(file => ({data: yamlPlatform.load(fs.readFileSync(file)), file}))
  .map(data => ({name: data.data.name, file: data.file, dir: path.dirname(data.file)}))
  .value()