dir[Symbol.asyncIterator]()
- 返回: <AsyncIterator> 一个 <fs.Dirent> 的异步迭代器
异步遍历目录,直到所有条目都被读取。有关更多详细信息,请参阅 POSIX readdir(3) 文档。
【Asynchronously iterates over the directory until all entries have
been read. Refer to the POSIX readdir(3) documentation for more detail.】
异步迭代器返回的条目始终是 <fs.Dirent>。dir.read() 的 null 情况在内部已处理。
【Entries returned by the async iterator are always an <fs.Dirent>.
The null case from dir.read() is handled internally.】
请参见 <fs.Dir> 了解示例。
【See <fs.Dir> for an example.】
此迭代器返回的目录条目没有特定顺序,它们是由操作系统的底层目录机制提供的。在迭代目录的过程中添加或删除的条目可能不会包含在迭代结果中。
【Directory entries returned by this iterator are in no particular order as provided by the operating system's underlying directory mechanisms. Entries added or removed while iterating over the directory might not be included in the iteration results.】