Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5298c81

Browse filesBrowse files
hgwoodsilverwind
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 <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Alexis Campailla <orangemocha@nodejs.org> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Roman Reiss <me@silverwind.io>
1 parent 1411e0b commit 5298c81
Copy full SHA for 5298c81

File tree

Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/modules.markdown‎

Copy file name to clipboardExpand all lines: doc/api/modules.markdown
+6Lines changed: 6 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.