So another registry? There are advantages of having a private registry
- Use private packages
- Cache npmjs.org registry
- Override public packages
You can specify module URL in package.json file as git repository path. This private git server can be part of your internal/private network and effectively makes the module to be private.
You can also have a local shared file system or a provision to download modules into the local system. Module URL can also be local machine file paths. This method is a little complicated and would require a lot of effort, IMHO!
Sinopia - Initially started as a caching repository, Sinopia allows you to host private repositories. It is an on-premise solution to handle private repositories.
To set up sinopia, install it on a private server (docker image is also available) and point npm to use this registry.
# config in config.yaml you can edit later) $ npm install -g sinopia $ sinopia # npm configuration $ npm set registry http://localhost:4873/ //private server address
Official Repo: Sinopia
Verdaccio is a fork of sinopia but is widely used. It promises to be a lightweight zero-config-required local private npm registry. Verdaccio comes out of the box with its own tiny database, and the ability to proxy other registries (eg. npmjs.org), caching the downloaded modules along the way.
The installation is same as sinopia, you set up verdaccio on private server (again it has docker image available) and point npm registry to your private server via
$ npm set registry http://localhost:4873/ //private server address
Official Repo: Verdaccio
cnpmjs is another private npm registry. It also has its public registry r.cnpmjs.org, syncing from registry.npmjs.com regularly.
It also works in the same manner as other private registries.
Official Repo: cnpmjs
Another private registry proxy but also has out of box support for cloud deployment. The inspiration for this project comes from sinopia. This came out of a need for better cache, CDN, and general performance as well as stability of being able to run multiple instances without depending on a local filesystem.
You can set up a private registry available over the internet via Heroku, S3 or Google cloud storage.
The usage is similar to other private registries. Point to the server with
npm set registry command.
Official Repo: npm-register