fs.Dirent 类


当使用 withFileTypes 选项设置为 true 调用 fs.readdir()fs.readdirSync() 时,生成的数组将填充 fs.Dirent 对象,而不是字符串或 Buffer

When fs.readdir() or fs.readdirSync() is called with the withFileTypes option set to true, the resulting array is filled with fs.Dirent objects, rather than strings or Buffers.