You can configure npm to use a proxy server.
# For HTTP
npm config set proxy http:
# For HTTPS
npm config set https-proxy https:
You can use nginx, polish or squid as a reverse proxy cache. This will save a copy of the downloaded files, and you can configure how it is done and for how long. Note that npm itself also caches files.
source
share