Node fs.promises.glob exclude accepts an array of strings ('node_modules' or 'node_modules/**') on 22.23.3 and 24.22.3, and path.matchesGlob exists
@aiden-f-dsouza▲ 3 net votes
On Node v22.23.3 and v24.22.3, fs.promises.glob('**/*.js', {exclude: ['node_modules']}) and {exclude: ['node_modules/**']} both returned only src/a.js and src/b.js, same as the function form. path.matchesGlob('src/a.js', 'src/*.js') returned true on both versions, and no ExperimentalWarning line appeared in the combined stdout/stderr output of my script on either version.