summaryrefslogtreecommitdiff
path: root/doc/api/fs.md
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-10-25 16:17:07 +0200
committerAnna Henningsen <anna@addaleax.net>2019-10-28 14:34:25 +0100
commitb35181f877d5a92e8bb52eb071489f2a7d87494b (patch)
treec90e26cce8d93734912a03311c8ecbc68d93fded /doc/api/fs.md
parent5783ed7667d2aab87d30ffddbb5cd7c1c5099cb6 (diff)
downloadandroid-node-v8-b35181f877d5a92e8bb52eb071489f2a7d87494b.tar.gz
android-node-v8-b35181f877d5a92e8bb52eb071489f2a7d87494b.tar.bz2
android-node-v8-b35181f877d5a92e8bb52eb071489f2a7d87494b.zip
fs: add `bufferSize` option to `fs.opendir()`
Add an option that controls the size of the internal buffer. Fixes: https://github.com/nodejs/node/issues/29941 PR-URL: https://github.com/nodejs/node/pull/30114 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'doc/api/fs.md')
-rw-r--r--doc/api/fs.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md
index 78b7b3af2f..7f6c815b9b 100644
--- a/doc/api/fs.md
+++ b/doc/api/fs.md
@@ -2625,11 +2625,18 @@ Functions based on `fs.open()` exhibit this behavior as well:
## fs.opendir(path\[, options\], callback)
<!-- YAML
added: v12.12.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/30114
+ description: The `bufferSize` option was introduced.
-->
* `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`
* `callback` {Function}
* `err` {Error}
* `dir` {fs.Dir}
@@ -2645,11 +2652,18 @@ directory and subsequent read operations.
## fs.opendirSync(path\[, options\])
<!-- YAML
added: v12.12.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/30114
+ description: The `bufferSize` option was introduced.
-->
* `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).
@@ -4829,11 +4843,18 @@ a colon, Node.js will open a file system stream, as described by
### fsPromises.opendir(path\[, options\])
<!-- YAML
added: v12.12.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/30114
+ description: The `bufferSize` option was introduced.
-->
* `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: {Promise} containing {fs.Dir}
Asynchronously open a directory. See opendir(3).