The docs under Module Caching 
Caveats<http://nodejs.org/api/modules.html#modules_module_caching_caveats>, 
it says

Modules are cached based on their resolved filename. Since modules may 
resolve to a different filename based on the location of the calling 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.


My take on this is that multiple copies of a file 'foo', each in a 
different node_modules directory would each be loaded separately and be 
different objects in the module cache.

Is there ever any case where a module in a single file could resolve to 
different filenames (and different cache objects)?

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to