Skip to content

paulvi/npm-proxy

Repository files navigation

npm-proxy

NPM Proxy Server ( NPS ? )

Proxy for Node.js NPM registry repository.

Dictionary

Repository is CouchDB database that contains Nodejs modules/packages.
Registry is main repository.
Proxy is software that acts as an intermediary for requests from clients seeking resources from other servers.
Clone is a copy of Registry.
Mirror repository is synchronized with Registry using CouchDB Replication feature.
Cached repository is updated from other repository (e.g. Registry) on per request basis.

Problem addressed

Registry as on March 11th 2013 is 36G of data in 25k projects. (Just navigate to https://registry.npmjs.org/)
Most development team don't need 99% of those packages, but quick & reliable access to those being used. Current recommendation to speed up access is clone Registry into new Repository (using continuous replication). This however creates additional pressure on Registry server, and on slow channels can't be finished within one session. But the most important every such attempt makes Registry even slower.

Status

This is work in progress. (Version 0.0.6) Now it is just ideas, some materials and occasionally failing code..

Please contact Paul Verest via skype pverest or call +86 187 01029146, if you are interested.

Usage

If you want only to use it, then bookmark (Ctrl+D) and/or star it now and return in June 2013.

  1. Install CouchDB server. There is quick installer for Windows since version 1.2
    For Linux Apache CouchDB wiki suggest to use build-couchdb
  2. Install NPM-Proxy server (this).
    • npm install npm-proxy // Help on this needed!
    • (Optionally) configure server URL, port, databases etc. (Defaults are http://localhost:6084/cached/, )
  3. Run via node npm-proxy.js
  4. Point npm to use NPM-Proxy server:
    npm config list
    npm config set registry=http://localhost:6084/cached/ (Later you can use npm config del registry to reset to default)
    or
    Use the --registry option every time:
    npm --registry http://localhost:6084/cached/ install packagename

Now your npm requests go through npm-proxy.

Developing

  1. Please contact first. Notes are not full. I present what I know with pleasure.
  2. There is '.project.example.xml' file with example how to configure comfy link in Eclise IDE.
  3. Start CouchDB.
    GUI environment (like Windows) is recommended. Run 'couchdb.bat' to launch also Erlang emulator, where you can track requests to CouchDB.
    Erlang_emulator
  4. CouchDB Futon UI can be useful http://localhost:5984/_utils/index.html
  5. main file is 'npm-proxy.js'. Run it with 'node npm-proxy.js' or via start-npm-proxy.bat.

Ideas

About

Smart proxy repository for NPM registry

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published