diff --git a/doc/api/fs.md b/doc/api/fs.md index 11dfb04df9c443..20c6b761c4c824 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -4170,11 +4170,16 @@ a colon, Node.js will open a file system stream, as described by ### fsPromises.readdir(path[, options]) * `path` {string|Buffer|URL} * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` + * `withFileTypes` {boolean} **Default:** `false` * Returns: {Promise} Reads the contents of a directory then resolves the `Promise` with an array @@ -4185,6 +4190,9 @@ 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. + ### fsPromises.readFile(path[, options])