From 1e6c6f6a1a706728bb9d24790181d4e1f11e4b90 Mon Sep 17 00:00:00 2001 From: Ethan Arrowood Date: Tue, 20 Dec 2022 11:49:35 -0700 Subject: [PATCH 01/12] fs: add recursive option to readdir and opendir Adds a naive, linear recursive algorithm for the following methods: readdir, readdirSync, opendir, opendirSync, and the promise based equivalents. Fixes: https://github.com/nodejs/node/issues/34992 --- doc/api/fs.md | 35 +++ lib/fs.js | 42 ++++ lib/internal/fs/dir.js | 93 ++++++-- lib/internal/fs/promises.js | 77 ++++++- lib/internal/fs/utils.js | 23 +- test/sequential/test-fs-opendir-recursive.js | 220 +++++++++++++++++++ test/sequential/test-fs-readdir-recursive.js | 193 ++++++++++++++++ 7 files changed, 653 insertions(+), 30 deletions(-) create mode 100644 test/sequential/test-fs-opendir-recursive.js create mode 100644 test/sequential/test-fs-readdir-recursive.js diff --git a/doc/api/fs.md b/doc/api/fs.md index 44bcd28a2ce638..9dc2cd49ab3fb9 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1214,6 +1214,9 @@ a colon, Node.js will open a file system stream, as described by + +* {string} + +The base path that this {fs.Dirent} object refers to. + ### Class: `fs.FSWatcher`