fs.opendirSync(path[, options])


    同步地打开目录。 参见 opendir(3)

    • path <string> | <Buffer> | <URL>
    • options <Object>
      • encoding <string> | <null> Default: 'utf8'
      • bufferSize <number> Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage. Default: 32
    • Returns: <fs.Dir>

    Synchronously open a directory. See opendir(3).

    Creates an <fs.Dir>, which contains all further functions for reading from and cleaning up the directory.

    The encoding option sets the encoding for the path while opening the directory and subsequent read operations.