Fetch npm modules. This is a work in progress.
var fetch = require('npm-fetch');
fetch('npm-fetch@0.0.1', __dirname + '/npm-fetch.tgz', function (err) {
if (err) throw err;
})
UNSTABLE
Fetch the package as a tarball to destination using the appropriate method.
name the name of the package as a stringspec a string which can be:
https or http as the scheme, where the module is hosted somewhere as a tarballusername/reponame#tag-name where #tag-name is optional and defaults to #masterDownload package at exact version and return a stream.
Download the max satisfying version of a package
Download the package name at tag and return a stream
Returns a stream for the GitHub repo as a tarball at the given tag (defaults to master)
e.g.
fetch.github('npm-fetch', 'ForbesLindesay/npm-fetch', {})
.pipe(fs.createWriteStream('npm-fetch.tar.gz'))
Not yet implemented
Get a stream for a tarball (handling redirects and retries).
Package up the directory at path and return a stream for the tarball.
Just create a read stream for path
BSD