diff options
author | Bryan English <bryan@bryanenglish.com> | 2018-09-12 21:32:29 -0700 |
---|---|---|
committer | Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> | 2018-09-14 21:12:17 -0700 |
commit | de37ba34c5d6f3a2d18daf482f850be8fddb4621 (patch) | |
tree | f8b131518164a885a8cec3759712f5679d21b3ea /doc/api/fs.md | |
parent | 70c2ebc1a19ff5b98ae3c1dd4e3997ca87079e63 (diff) | |
download | android-node-v8-de37ba34c5d6f3a2d18daf482f850be8fddb4621.tar.gz android-node-v8-de37ba34c5d6f3a2d18daf482f850be8fddb4621.tar.bz2 android-node-v8-de37ba34c5d6f3a2d18daf482f850be8fddb4621.zip |
doc: add withFileTypes option to fsPromises.readdir
PR-URL: https://github.com/nodejs/node/pull/22833
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'doc/api/fs.md')
-rw-r--r-- | doc/api/fs.md | 8 |
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 |