If you don't want to go through the trouble of managing npm link
you can call your development directory node_modules
, like so:
$ mkdir node_modules
$ cd node_modules
$ git clone project1
$ git clone project2
Now if project1 has a dependency on project2 but you want to develop against your local version:
$ cd project1
$ npm uninstall project2
Now when node tries to resolve the project2 dependency in project1, it will walk up the directory tree to your cleverly-named node_modules
and find the dependency it's looking for. When you want to use the published version again, just go into project 1 and npm install again.