Socket
Book a DemoInstallSign in
Socket

npm-fetch

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-fetch

Fetch an npm module as a tarball

latest
Source
npmnpm
Version
0.0.9
Version published
Maintainers
2
Created
Source

npm-fetch

Fetch npm modules. This is a work in progress.

Build Status Dependency Status NPM version

Usage

var fetch = require('npm-fetch');
fetch('npm-fetch@0.0.1', __dirname + '/npm-fetch.tgz', function (err) {
  if (err) throw err;
})

API

fetch(name, spec, dest, options, cb)

UNSTABLE

Fetch the package as a tarball to destination using the appropriate method.

  • name the name of the package as a string
  • spec a string which can be:
    • a version, version range or tag if the module is in the npm repository
    • a url with https or http as the scheme, where the module is hosted somewhere as a tarball
    • a git url, where the module will be cloned as a git repository
    • a GitHub specifier of the form username/reponame#tag-name where #tag-name is optional and defaults to #master
    • a path to a local file or folder

npm.version(name, version, options)

Download package at exact version and return a stream.

npm.range(name, versionRange, options)

Download the max satisfying version of a package

npm.tag(name, tag, options)

Download the package name at tag and return a stream

github(name, 'user/repo#tag', options)

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'))

git(name, url, options)

Not yet implemented

tarball(name, url, options)

Get a stream for a tarball (handling redirects and retries).

local.dir(name, path, options)

Package up the directory at path and return a stream for the tarball.

local.file(name, path, options)

Just create a read stream for path

License

BSD

FAQs

Package last updated on 25 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts