We have one poor soul who stubbornly refuses to give up windows, so the 
symlink trick won't work for us.  So we do this:  

in the node_modules folder of module a, we put a file named:

module_b.js

it contains this line:

module.exports = require('../../path/to/module_b')

We use the same trick for any utility libs that are shared project wide but 
are not in npm.  

It allows us to to say everywhere 

  var ourUtils = require('ourUtils')

instead of 

  var ourUtils = require('../../brittle/path/to/ourUtils')

in all files but the one redirector.  

I used to think this was a big old hack, but after living with it for a 
while we like it just fine, even on windows. :)

-g 



On Saturday, December 7, 2013 10:48:37 AM UTC-8, Dave Horton wrote:
>
> I'm developing two related modules concurrently -- module A depends on 
> module B.  Neither is anywhere near a state where I want to put them into 
> npm yet, so I can't simply have module A have a dependency on B in its 
> package.json and leave it at that.  I'm thinking what I will do is have the 
> projects in separate folders (separate git repos) on my laptop, and then 
> just make a symbolic link under A/node_modules to where B is, so I can 
> modify B real-time and then test it as I run tests/examples on A.  
>
> But I'm thinking this must be common, and whether smarter people than me 
> have figured out a better approach for this...
>

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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to