An NPM Proxy Server
NPMZor is a aggregating and caching NPM Registry server. The purpose of this project is to:
NOTE: Still under development, in need of a nice 'Green Refactor'
To be done:
This project came about as the company I work for have a rather complicated proxy setup which makes development and CI environments a bit of a nightmare to manage. We also had the requirement to host modules which have been built internally on our CI environment available to the developers and builds of other modules.
I wanted the development team, and CI environment to be able to point to a single point, and that single point would serve up internal modules, as well as traversing external registries if required via the relevant proxy and returning the result, and caching those results where possible.
At the moment, edit clone this repo, npm install, edit /config/production/production.js to suit, and type:
ENV=production node app.js
You'll then need to point your NPM config to the new server with:
npm config set registry
If you want to host your own npm modules on the server, PUT them:
curl -X PUT -F module=@./simple-empty-app-0.0.1.tgz
Internal modules will always be favoured over external modules when a client requests a module or index. NOTE: If you push the same version multiple times (npmjs.org) does not allow this, you will need to do 'npm cache clear' on the client before doing 'npm install'
Npmzor does a couple of things registry.npmjs.org does not. One of these is the ability to get the /latest information To get the latest package version json:
To download the latest package:
I also use the excellent mocking library Deride (https://github.com/REAANDREW/deride).
Further to this, the branching strategy is gitflow (https://github.com/nvie/gitflow), so please ensure you do your work in feature branches first.
You can run tests with the following:
ENV=local grunt (this will run the full suite)ENV=local grunt mochaTest:unitENV=local grunt mochaTest:integrationENV=local grunt mochaTest:acceptance
Copyright (c) 2014 Karl Stoney
Licensed under the MIT license.