Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

gh-clone

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh-clone

git clone a repo with only username/repo.

Source
npmnpm
Version
0.4.1
Version published
Maintainers
2
Created
Source

gh-clone NPM version NPM downloads Build Status

git clone a repo with only username/repo.

Install

Install globally with npm

$ npm install -g gh-clone

CLI Usage

Let's say you want to clone micromatch:

$ gh-clone [owner/repo] <commands>

Examples

owner/repo

You can pass github owner name/repo:

$ gh-clone jonschlinkert/micromatch

repo

If you pass the repository name only, gh-clone will resolve the git url from the package.json hosted on npm.

$ gh-clone micromatch

flags

  • -r|--repo: the repository to clone
  • -b|--branch: the branch to clone
  • -d|--dest: the local destination

Example: branch

Flags can be used in any order. If you want the dev branch of micromatch (when one exists):

$ gh-clone jonschlinker/micromatch -b dev

Example: destination

If you want to save to the foo directory

$ gh-clone jonschlinker/micromatch -d foo

Example: branch and destination

If you want to save the dev branch to the foo directory

$ gh-clone jonschlinker/micromatch -b dev -d foo

API Usage

var clone = require('gh-clone');

clone

Clone a repo with the given options:

Params

  • options {Object}: Options
  • repo {String}: Repository to clone.
  • branch {String}: Branch on repository to clone.
  • dest {String}: Destination folder to clone to.
  • cb {Function}: Callback

Example

clone({repo: 'jonschlinkert/micromatch'}, function(err) {
  if (err) return console.error(err);
});

.clone.normalize

Normalizes options into a configuration object.

Params

  • options {Object}: Options
  • repo {String}: Repository to clone.
  • branch {String}: Branch on repository to clone.
  • dest {String}: Destination folder to clone to.
  • cb {Function}: Callback

Example

clone.normalize({repo: 'jonschlinkert/micromatch'}, function(err, config) {
  if (err) return console.error(err);
  console.log(config);
});

You might also be interested in these projects:

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.

This file was generated by verb, v0.9.0, on June 18, 2016.

Keywords

clone

FAQs

Package last updated on 18 Jun 2016

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