joyent/node — pull request #8377 by luckysw (2014-09-16 10:51:08+00:00)
Title: Enhance "outdated" and "update" command to work with http/https remote tarballs 

Hi,
We are working with some remote tarballs, referred using its direct http/https URL in the dependency/devDependencies list.
We found that npm caches the content of that tarball using the URL as unique key.
This is absolutely fine for "tagged" release that never changes. However if we want to support a snapshot-like based deployment (in our continous-integration environment), we would like to release "-SNAPSHOT" remote tarballs.

Simply using "npm cache clean " doesn't work, since the command cleans the local cache, but not the "node_modules" local folder.

So I've tried to enhance npm with the minimum set of changes, in order to make the "outdated" command to actively check the remote repos.
Changes:
- the local 'package.json' is enriched with a new property (_remote) containing some useful information about the GET response headers (etag, modification date) and the URL.
- the 'fetch' module was improved in order to issue a "HEAD" request instead of a "GET" request when the 'local' parameter is not set. (This is the biggest change. If not like, I could duplicate the 'fetch' code in a different class, but the change should be safe).
- some refactoring to avoid duplicated code...

Sorry, I don't know how to remove a single commit from the git pull request, where I only added the Visual Studio solution I worked on (obviously this is NOT supposed to be pulled).

Thank you for this great tool!
Luciano