Quick tip: npm lets you install directories, which is occasionally useful for organizing projects. For example, as a temporary step before uploading packages to npm (think lightweight npm link ).

An example project #

As an example, let’s assume, we are writing a suite of Node.js-based CLI tools:

suite_of_tools/ tool1/ tool2/ helpers/

Each of tool1 , tool2 and helpers is an npm package with its own package.json and node_modules/ .

npm-installing the directory helpers/ #

npm lets you do:

$ cd tool1/ $ npm install ../helpers

Then npm does the following:

It installs the dependencies of helpers .

. It adds a symlink to ../../helpers/ in tool1/node_modules .

in . It adds an entry to the dependencies: "dependencies" : { "helpers" : "file:../helpers" , ··· }