From 310bc98c1785309feb4dce455dfff610bdceb8d8 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 23 Jul 2025 15:51:45 -0700 Subject: [PATCH] fs: improve performance for fs.globSync() Ref: https://github.com/nodejs/node/pull/57725/files#r2024884348 --- lib/internal/fs/glob.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/fs/glob.js b/lib/internal/fs/glob.js index 14180f936ac1c8..61922d5244d7d2 100644 --- a/lib/internal/fs/glob.js +++ b/lib/internal/fs/glob.js @@ -332,7 +332,7 @@ class Glob { const fullpath = resolve(this.#root, path); // If path is a directory, add trailing slash and test patterns again. - if (this.#isExcluded(`${fullpath}/`) && this.#cache.statSync(fullpath).isDirectory()) { + if (this.#isExcluded(`${fullpath}/`) && internalBinding('fs').internalModuleStat(fullpath) === 1) { return; }