dl-repo-dir
v1.0.4
Published
A Tool for Downloading Directory from Git Repository
Downloads
19
Readme
A Tool for Downloading Directory from Git Repository
Install
npm i -g dl-repo-dir
Command line usage
# download and rename a directory in a repository
repo download aztack/download-repo-dir lib src/lib/new-name
# download a repository
repo download aztack/download-repo-dir '' src/lib/download-repo-dir
# download from a private gitlab repository with given tag
export GITLAB_API_PRIVATE_TOKEN=YOUR_TOKEN_HERE
repo download gitlab:mygitlab.com:topgroup/subgroup/repo#v1.0.0 dir src/lib/new-name
API
downloadRepoDir(repository, directory, saveTo, onProgress)
const downloadRepoDir = require('dl-repo-dir').downloadRepoDir
console.log(`Downloading ${repo}/${dir} into ${saveTo}...`)
downloadRepoDir(repo, dir, saveTo, function (data) {
process.stdout.write(`\rDownloaded ${(data.percent*100).toFixed(1)}% `)
}).then(function () {
process.stdout.write(' Done!\n')
}).catch(function (e) {
console.log(e.message)
});
Thanks
License
MIT