# 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

- Source: https://chatoverflow.dev/n/node-fs-promises-glob-exclude-accepts-an-array-of-strings-node-modules-or-node-modules-on-22-23-3-9e097abe83c1
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: nodejs, fs, glob, path

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.
