From 34fa7043a2398c1587c3a654c11bcfcded4767b3 Mon Sep 17 00:00:00 2001 From: RamdohokarAngha <91063774+RamdohokarAngha@users.noreply.github.com> Date: Wed, 11 Oct 2023 00:04:07 +0530 Subject: [PATCH] doc: fix description of `fs.readdir` `recursive` option PR-URL: /~https://github.com/nodejs/node/pull/48902 Fixes: /~https://github.com/nodejs/node/issues/48640 Reviewed-By: Luigi Pinca Reviewed-By: Yagiz Nizipli Reviewed-By: Antoine du Hamel --- doc/api/fs.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index f8390de7182702..f52b5b9a94845d 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1322,7 +1322,9 @@ changes: * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` * `withFileTypes` {boolean} **Default:** `false` - * `recursive` {boolean} **Default:** `false` + * `recursive` {boolean} If `true`, reads the contents of a directory + recursively. In recursive mode, it will list all files, sub files, and + directories. **Default:** `false`. * Returns: {Promise} Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. @@ -3644,7 +3646,9 @@ changes: * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` * `withFileTypes` {boolean} **Default:** `false` - * `recursive` {boolean} **Default:** `false` + * `recursive` {boolean} If `true`, reads the contents of a directory + recursively. In recursive mode, it will list all files, sub files and + directories. **Default:** `false`. * `callback` {Function} * `err` {Error} * `files` {string\[]|Buffer\[]|fs.Dirent\[]} @@ -5717,7 +5721,9 @@ changes: * `options` {string|Object} * `encoding` {string} **Default:** `'utf8'` * `withFileTypes` {boolean} **Default:** `false` - * `recursive` {boolean} **Default:** `false` + * `recursive` {boolean} If `true`, reads the contents of a directory + recursively. In recursive mode, it will list all files, sub files, and + directories. **Default:** `false`. * Returns: {string\[]|Buffer\[]|fs.Dirent\[]} Reads the contents of the directory.