On Mon, Jan 14, 2013 at 4:02 PM, Angel Java Lopez <[email protected]>wrote:

> Well, it could be that B uses C-0.0.1 (declared in its package.json), and
> A uses C-0.0.2
>
> So
>
> A --> B --> C-0.0.1
> A --> C-0.0.2
>
> node_modules/A/node_modules/B/node_modules/C <-- C-0.0.1 here
> node_modules/A/node_modules/C <-- C-0.0.2 here
>
>
Thanks, I realized that I was dreadfully unclear about this in my response.

Rick



>
> On Mon, Jan 14, 2013 at 5:49 PM, Dan Milon <[email protected]> wrote:
>
>> Dependencies (aka `require`s) are resolved synchronously.
>>
>> So the flow is:
>> A --> B --> C
>> A --> C
>>
>> Also modules are cached. [1] ie, they are not loaded twice. A and B
>> "see" the same version of C.
>>
>> [1] http://nodejs.org/docs/latest/api/modules.html#modules_caching
>>
>> Hope this helps,
>> danmilon.
>>
>> On 01/14/2013 09:45 PM, Thiago Souza wrote:
>> > Hello all,
>> >
>> > I've got a basic dependency question. Consider the following
>> > dependencies:
>> >
>> > (module A) --> (module B) (module A) --> (module C) (module B) -->
>> > (module C)
>> >
>> > So, C is a shared dependency between A and B, but A also depends on
>> > B. My question is, will A and B share the same C module instance?
>> > If so, what code base will be used?
>> >
>> > Cheers, Thiago Souza
>> >
>> >
>> >
>> >
>> > -- 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
>>
>> --
>> 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
>>
>
>  --
> 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
>

-- 
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