README
download git repo
down a git repository, support github
, gitlab
, bitbucket
, gitee(码云)
Installation
$ npm install get-git-repository
or:
$ yarn add get-git-repository
Usage
const download = require('get-git-repository')
// owner/repository => download from github
// github:owner/repository => download from github
// gitlab:owner/repository => download from gitlab
// gitee:owner/repository => download from gitee
// bitbucket:owner/repository => download from bitbucket
const repo = '/huoqishi/x-html'
download(repo, 'test/').then(() => {
console.log('ok')
})
API
download
download(repo, savePath, [options])
clone repo
to savePath
, return promise
on completion.
options
clone
: default false, If true usegit clone
instead of an http download。if download from gitee(码云), api will auto set clone = true。
shallow
: whentrue
, clone with depth 1 (optional).checkout
: revision/branch/tag to check out (optional).
Copyright & License
© huoqishi & 火骑士空空
Released under the MIT.
目前问题: 没有删除.git文件夹