阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js fsPromises.readdir

      Node.js fsPromises.readdir(path[, options])

      版本历史

      版本变更
      v10.11.0New option withFileTypes was added.
      v10.0.0新增于: v10.0.0
      • path < string> | < Buffer> | < URL>
      • options < string> | < Object>
        • encoding < string> Default: ‘utf8’
        • withFileTypes < boolean> Default: false
      • Returns:

      Reads the contents of a directory then resolves the Promise with an array of the names of the files in the directory excluding ‘.’ and ‘..’.

      The optional options argument can be a string specifying an encoding, or an object with an encoding property specifying the character encoding to use for the filenames. If the encoding is set to ‘buffer’, the filenames returned will be passed as Buffer objects.

      If options.withFileTypes is set to true, the resolved array will contain fs.Dirent objects.


      更多内容请参考:Node.js fs 文件系统,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录