Hi Osher,
There are multiple options for setting up a private repo, unfortunately none of them is ideal.
2. Setup your own registry using CouchDB and npmjs code, but don't replicate the public registry
3. Use a different registry server, e.g. reggie [1] mentioned by Andy
Let's check your requirements:
we don't want to host an entire replica of the npm (which is HUGE these days, and growing)
i.e - the private replica should hold only our packages, the rest can come from the public repo
This is true for options 2 and 3.
publishing should direct to our repo
This can be achieved with all three options. Either add the following line to your package.json
or use the reggie CLI client for publishing the packages.
install should take our packages from our repo, and public packages from the global repo
The npm client does not support multiple repositories at the moment, even though there are plans to get this implemented in the next few weeks/months. Unless you have a replica of npmjs.org (option 1), you must use different way for installing and referencing packages from public and private repository.
With couchdb-based registry, you can use absolute URL to the tarball of the desired version. (This means you can't specify a fuzzy version like ~0.5.2.)
Node reggie implements several kinds of package URLs to support fuzzy version specification. See project README [1] for more details.
It may be possible to overcome this limitation by sticking an npm proxy [2] in front of your private registry.
users in local repo should match users in global repo
You will get this for free with npmjs.or replica.
If its possible to setup CouchDB replication in such way that only users are replicated, then you can get this functionality with non-replicated CouchDB-based registry too.
Reggie does not implement authentication and authorization at the moment - it will happily accept (and ignore) whatever credentials are sent by the npm client.
I hope you will find this helpful, don't hesitate to ask if there is anything else not clear.
Miroslav