npm is actually quite smart about this,
if app and swig both have underscore in thier package.json it will
install like this

after a fresh install, if they depend on the same version of underscore

app/node_modules/swig
app/node_modules/underscore

or if they need different versions it will be like this:

app/node_modules/swig
app/node_modules/swig/node_modules/underscore
app/node_modules/underscore

here swig gets it's own version.
this is a really great way to do it because prevents dependency hell.
which means, you can break your api, and wont break people's apps,
as long as you use module versions correctly.


On Sun, Jun 24, 2012 at 2:13 PM, Angelo Chen <angelochen...@gmail.com> wrote:
> right, thanks.
>
> On Jun 24, 10:10 am, Ryan Schmidt <google-2...@ryandesign.com> wrote:
>> On Jun 23, 2012, at 21:04, Angelo Chen wrote:
>>
>> > I use swig in my node app, and I know swig uses underscore, do i have
>> > to npm install underscore, or just use the one being used by swig?
>>
>> Install your own copy of underscore and use that. Do not rely on internal 
>> details of modules that might change in the future (i.e. do not rely on the 
>> fact that swig uses underscore today, because it might not do so tomorrow, 
>> or it might change to a different version of underscore with which your code 
>> is not compatible).
>
> --
> 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 nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> 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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to