Socket
Socket
Sign inDemoInstall

gitclone

Package Overview
Dependencies
21
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gitclone

Powerful and flexible programmatic interface for the `git clone` command, using [gitclone-defaults][] and [cross-spawn][]


Version published
Weekly downloads
8
decreased by-75%
Maintainers
1
Install size
239 kB
Created
Weekly downloads
 

Changelog

Source

2.0.0 - 2016-11-01

  • Stable release
  • releasing flow and automation
  • semantic versioning
  • update boilerplate
  • add tests
  • refactor

Readme

Source

gitclone npmjs.com The MIT License npm downloads

Powerful and flexible programmatic interface for the git clone command, using gitclone-defaults and cross-spawn

code climate standard code style travis build status coverage status dependency status

Install

Install with npm

$ npm i gitclone --save

Usage

For more use-cases see the tests

const gitclone = require('gitclone')

API

gitclone

Clones github repository, optionally pass destination folder. By defaults uses HTTPS to clone the repository. If you want SSH clone you should pass second, third or fourth argument boolean true, or object {ssh: true}. Pattern can be user/repo#branch as first argument. Or first argument user, second argument repo, third branch, fourth ssh.

Hint: All arguments are super flexible and they are handled absolutely directly with gitclone-defaults, so read its API docs. In addition, you also can pass callback as last argument, otherwise it will return Spawn stream.

Params

  • [callback] {Function}: optional, if not given, returns a stream
  • returns {Stream}: if not callback given as last argument - a Spawn stream

Example

const gitclone = require('gitclone')

// clones with SSH
gitclone('node-minibase/minibase', true)

// clone with HTTPS
gitclone('node-minibase/minibase', (err) => {
  if (err) return console.error(err)
})

// clone `dev` branch from `verbose/verb` repo
gitclone('verbose/verb#dev', console.log)

// clone `jonschlinkert/nanomatch` with SSH
gitclone('jonchlinkert', 'nanomatch', true)

// clone to different destination folder
gitclone('hybridables/always-done', { dest: 'foobar' })

// clone SSH + dest + branch
gitclone('verbose/verb', { dest: 'verb0.9.0', branch: 'dev', ssh: true })

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckoCore.tk keybase tunnckoCore tunnckoCore npm tunnckoCore twitter tunnckoCore github

Keywords

FAQs

Last updated on 01 Nov 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc