diff --git a/doc/api/path.md b/doc/api/path.md index caefc15e601f1a..3d94f15eea556e 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -87,6 +87,19 @@ path.basename('/foo/bar/baz/asdf/quux.html', '.html'); // Returns: 'quux' ``` +Although Windows usually treats file names, including file extensions, in a +case-insensitive manner, this function does not. For example, `C:\\foo.html` and +`C:\\foo.HTML` refer to the same file, but `basename` treats the extension as a +case-sensitive string: + +```js +path.win32.basename('C:\\foo.html', '.html'); +// Returns: 'foo' + +path.win32.basename('C:\\foo.HTML', '.html'); +// Returns: 'foo.HTML' +``` + A [`TypeError`][] is thrown if `path` is not a string or if `ext` is given and is not a string.