Socket
Socket
Sign inDemoInstall

download-git-repo

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

download-git-repo

Download and extract a git repository (GitHub, GitLab, Bitbucket) from node.


Version published
Weekly downloads
101K
increased by7.05%
Maintainers
1
Weekly downloads
 
Created
Source

download-git-repo

Download and extract a git repository (GitHub, GitLab, Bitbucket) from node.

Installation

$ npm install download-git-repo

API

download(repository, destination, options, callback)

Download a git repository to a destination folder with options, and callback.

repository

The short hand repository string to download the repository from:

  • GitHub - github:owner/name or simply owner/name
  • GitLab - gitlab:owner/name
  • Bitbucket - bitbucket:owner/name

The repository parameter defaults to the master branch, but you can specify a branch or tag as a URL fragment like owner/name#my-branch. In addition to specifying the type of where to download, you can also specify a custom origin like gitlab:custom.com:owner/name. Custom origin will default to HTTPS unless protocol is specified. Feel free to submit an issue or pull request for additional origin options.

destination

The file path to download the repository to.

options

An optional options object parameter with download options. Options include:

  • clone - boolean default false - If true use git clone instead of an http download. While this can be a bit slower, it does allow private repositories to be used if the appropriate SSH keys are setup.
callback

The callback function as function (err).

Examples

Using http download from Github repository at master.

download('flipxfx/download-git-repo-fixture', 'test/tmp', function (err) {
  console.log(err ? "Error" : "Success")
})

Using git clone from Bitbucket repository at my-branch.

download('flipxfx/download-git-repo-fixture#my-branch', 'test/tmp', function (err) {
  console.log(err ? "Error" : "Success")
})

Thanks

To ianstormtaylor/download-github-repo for the head start.

License

MIT

Keywords

FAQs

Package last updated on 10 Apr 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc