If you use Bitbucket to host your Mercurial repo project, it provides links to download snapshots of your project as a tar.gz file. These URLs are really useful in package.json dependencies.
For example, my pagedown project page download page contains a link to this URL for a snapshot with the last change to the default gzip branch:
https://bitbucket.org/ncraike/pagedown/get/default.tar.gz
so in another package.json project I can specify:
"dependencies": { "pagedown": "https://bitbucket.org/ncraike/pagedown/get/default.tar.gz" }
npm handles this tone when I do npm install from a dependent package, installing it correctly in the node_modules subdirectory.
This is not a general solution for Mercurial repositories (and I agree that it would be nice if the NPM accepted Mercurial URLs), but it can be a reasonable workaround if you use Bitbucket or a similar hosting site.
source share