Closed
Labels
fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Description
Version
24.3.0
Platform
x64 windows
Subsystem
No response
What steps will reproduce the bug?
on windows
files structure
root
|_ a
| node_modules
let r = await glob("a/node_moduleS", {
cwd: "root",
})
let files = await Array.fromAsync(r)
console.log(files);
output
['a'\\node_moduleS`]
This is the first issue, the result preserves the original glob casing instead of the casing on the filesystem
expected
-['a'\\node_moduleS`]
+['a'\\node_modules`]
when we try to exclude with the actual casing on the filesystem
the exclude actually uses case aware, and in this case it fails to exclude the actual path
on the file system
let r = await glob("a/node_moduleS", {
cwd: "root",
exclude: ["a/node_modules"]
})
let files = await Array.fromAsync(r)
console.log(files);
output
[ 'a\\node_moduleS' ]
instead of the expected
- [ 'a\\node_moduleS' ]
+ []
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
- globing should always return the actual casing from the filesystem
- if the glob pattern is case insensitive so should the exclude patterns.
- we should be able to configure the casing of the matcher because on windows we may have case sensitive file system too. see final note for the proposal of enhancement
What do you see instead?
- on windows the glob results are returned with the casing of the pattern instead of preserving the filesystem casing
- the exclude patterns are case sensitive
Additional information
Additionally I think the glob case sensitive should be configurable
either be explicitly
await glob("a/node_moduleS", {
cwd: "root",
casing: "default", // default - window case-insensitive , linux - case sensitive
// yes - case sensitive regardless of operation system
// no - case insensitive regardless of operation system
})
windows also supports case sensitive file system as you can see here
https://learn.microsoft.com/en-us/windows/wsl/case-sensitivity
.Reacted by Louie Llaneta
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Activity
github-actions commentedon Apr 19, 2026
This issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
mizulu commentedon Apr 19, 2026
still a bug
github-actions commentedon Jul 20, 2026
This issue has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
mizulu commentedon Jul 20, 2026
still a bug
fs: apply nocase to literal glob exclude patterns
fs: apply nocase to literal glob exclude patterns
fs: apply nocase to literal glob exclude patterns
fs: apply nocase to literal glob exclude patterns
fs: apply nocase to literal glob exclude patterns
fs: apply nocase to literal glob exclude patterns