Skip to content

Commit

Permalink
doc: require behavior on case-insensitive systems
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hgwood authored and Myles Borins committed Mar 1, 2016
1 parent b6bd874 commit 3106297
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/api/modules.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ module (loading from `node_modules` folders), it is not a *guarantee*
that `require('foo')` will always return the exact same object, if it
would resolve to different files.

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

## Core Modules

<!--type=misc-->
Expand Down

0 comments on commit 3106297

Please sign in to comment.