Skip to content

Commit 378a772

Browse files
hgwoodrvagg
authored andcommitted
doc: require behavior on case-insensitive systems
This adds a paragraph in the Module Caching Caveats section about the behavior of require when Node is running on top of a file system (e.g. HFS) or operating system (e.g. Windows) that will not consider the case of file paths to find files. Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Alexis Campailla <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent 06b7eb6 commit 378a772

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/api/modules.markdown

+6
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ module (loading from `node_modules` folders), it is not a *guarantee*
212212
that `require('foo')` will always return the exact same object, if it
213213
would resolve to different files.
214214

215+
Additionally, on case-insensitive file systems or operating systems, different
216+
resolved filenames can point to the same file, but the cache will still treat
217+
them as different modules and will reload the file multiple times. For example,
218+
`require('./foo')` and `require('./FOO')` return two different objects,
219+
irrespective of whether or not `./foo` and `./FOO` are the same file.
220+
215221
## Core Modules
216222

217223
<!--type=misc-->

0 commit comments

Comments
 (0)