We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v22.5.0
Linux razerbook-og 6.11.7-100.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 8 19:07:28 UTC 2024 x86_64 GNU/Linux
fs
Create the following files to scan:
scan/ subdir/ a.js .b.js
Create the following script:
'use strict' const fsp = require('node:fs/promises') ;(async () => { const globs = [ 'scan/subdir/{.,}*.js', 'scan/*/{.,}*.js', 'scan/**/{.,}*.js', 'subdir/{.,}*.js', '*/{.,}*.js', '**/{.,}*.js', ] for (const glob of globs) { console.log('glob: ' + glob) if (glob.startsWith('subdir/')) process.chdir('scan') for await (const entry of fsp.glob(glob)) { console.dir(entry) } } })()
Whenever ** is used in the pattern, the dot (hidden) files are not matched, even though the pattern specifically requests them.
**
Always reproducible as long as ** is used in the pattern and the pattern is matching dot (hidden) files.
If the pattern is * or an explicit directory name, then the dot (hidden) files are matched. So this is specific to using globstar (**).
*
The dot (hidden) files should be matched after the globstar because the pattern is specifically requesting them.
When globstar is used in the pattern, the dot (hidden) files are not matched.
The described scenario works as expected using node-glob and bash, so the behavior of the built-in function in Node.js is inconsistent.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Version
v22.5.0
Platform
Subsystem
fs
What steps will reproduce the bug?
Create the following files to scan:
Create the following script:
Whenever
**
is used in the pattern, the dot (hidden) files are not matched, even though the pattern specifically requests them.How often does it reproduce? Is there a required condition?
Always reproducible as long as
**
is used in the pattern and the pattern is matching dot (hidden) files.If the pattern is
*
or an explicit directory name, then the dot (hidden) files are matched. So this is specific to using globstar (**
).What is the expected behavior? Why is that the expected behavior?
The dot (hidden) files should be matched after the globstar because the pattern is specifically requesting them.
What do you see instead?
When globstar is used in the pattern, the dot (hidden) files are not matched.
Additional information
The described scenario works as expected using node-glob and bash, so the behavior of the built-in function in Node.js is inconsistent.
The text was updated successfully, but these errors were encountered: