We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d60c487 commit 3954b8fCopy full SHA for 3954b8f
doc/api/path.md
@@ -87,6 +87,19 @@ path.basename('/foo/bar/baz/asdf/quux.html', '.html');
87
// Returns: 'quux'
88
```
89
90
+Although Windows usually treats file names, including file extensions, in a
91
+case-insensitive manner, this function does not. For example, `C:\\foo.html` and
92
+`C:\\foo.HTML` refer to the same file, but `basename` treats the extension as a
93
+case-sensitive string:
94
+
95
+```js
96
+path.win32.basename('C:\\foo.html', '.html');
97
+// Returns: 'foo'
98
99
+path.win32.basename('C:\\foo.HTML', '.html');
100
+// Returns: 'foo.HTML'
101
+```
102
103
A [`TypeError`][] is thrown if `path` is not a string or if `ext` is given
104
and is not a string.
105
0 commit comments