Skip to content

aichbauer/node-git-clone-repo

Repository files navigation

git-clone-repo

Clone a git repository

Build Status Build status Coverage Status

Installation

$ npm i git-clone-repo --save

or

$ yarn add git-clone-repo

Usage

const gitCloneRepo = require('git-clone-repo'); // import gitCloneRepo from 'git-clone-repo'

// clones the repo to your current working dir
gitCloneRepo('www.github.com/username/repo-that-exists'); // => true

// clones the repo to your current working dir
gitCloneRepo('https://www.github.com/username/repo-that-exists'); // => true

// clones the repo to your current working dir
gitCloneRepo('username/repo-that-exists', { host: 'bitbucket.com' }); // => true

// clones the repo to your current working dir + 'your/destination/path'
gitCloneRepo('username/repo-that-exists', { 
  host: 'bitbucket.com', 
  destination: 'your/destination/path' 
}); // => true

// automatically checks github if no host is provided
gitCloneRepo('username/repo-that-not-exists'); // => false

LICENSE

MIT © Lukas Aichbauer