From 2622646f350800a9986476632791f12ee8413bd2 Mon Sep 17 00:00:00 2001 From: jorge guerrero Date: Sun, 1 Mar 2026 20:03:54 -0500 Subject: [PATCH] fs: honor encoding option in glob APIs Align glob, globSync, and fsPromises.glob with encoding semantics. When encoding is 'buffer', return Buffer paths and Buffer dirent names. Add regression tests and documentation updates to lock behavior. --- doc/api/fs.md | 23 +++- lib/internal/fs/glob.js | 204 ++++++++++++++++++++++++--------- test/parallel/test-fs-glob.mjs | 181 ++++++++++++++++++++++++++++- 3 files changed, 350 insertions(+), 58 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 66d29bc80fbf18..482bceeaf3f96a 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1086,6 +1086,8 @@ behavior is similar to `cp dir1/ dir2/`.