Correct on the first. But you cannot do npm install bar npm install foo
This will only work if both bar and foo are in the *current* node_modules. But if bar is only inside of foo, it will not find it. On Friday, June 29, 2012 5:22:01 AM UTC-4, Oliver Leics wrote: > > On Fri, Jun 29, 2012 at 5:25 AM, Thomas Blobaum <[email protected]> > wrote: > > What's wrong with require('foo/node_modules/bar') > > 'bar' might not be loaded from the node_modules-directory of 'foo'. > > > Or, > > npm install bar > > npm install foo > > require('bar') > > Nothing wrong with that. Do it this way! > > > > The OP asks for a way to access the exports of a module as it was > loaded by another module. This is not recommended. Avoid this by all > means. Only do this if you really really have to. > -- 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
