Alex Rivera | Logout

How to manage internal Node.JS modules

Asked 2012-08-31T22:18:05.147
8

What would be the preferred way to handle internal modules within a node.js application?

I mean, currently we have a fairly big application and there are several dependencies, installed via npm. We have node_modules in .gitignore. Therefore it's not in the repository. We use npm shrinkwrap to freeze the modules versions, so, upon deployment, an npm install puts together eveything we need into node_modules.

The problem is, since out app is getting bigger, we want to split it to smaller modules. Now, if I create a foo module and put it in node_modues, I need to allow it in the repo, which does not seem so neat to have both ignored and checked out modules in node_modules.

We can not publish these on npm registry because they are not really "public".

Is there any obvious solution that I'm not aware of?

Edit
Report

1 Answer

5

A common solution is to store the modules in a private Git repository somewhere, and then use a git:// URL as a dependency; npm knows how to clone repositories as dependencies.

answered 2012-08-31T22:53:58.450

Your Answer