summaryrefslogtreecommitdiff
path: root/doc/api/fs.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/fs.md')
-rw-r--r--doc/api/fs.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md
index bade7dc750..8eb85bee5f 100644
--- a/doc/api/fs.md
+++ b/doc/api/fs.md
@@ -4196,11 +4196,16 @@ a colon, Node.js will open a file system stream, as described by
### fsPromises.readdir(path[, options])
<!-- YAML
added: v10.0.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/22020
+ description: New option `withFileTypes` was added.
-->
* `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
@@ -4211,6 +4216,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])
<!-- YAML
added: v10.0.0