Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aztack/download-repo-dir
A Tool for Downloading Directories of A Git Repository
https://github.com/aztack/download-repo-dir
bitbucket download git github gitlab repository
Last synced: 1 day ago
JSON representation
A Tool for Downloading Directories of A Git Repository
- Host: GitHub
- URL: https://github.com/aztack/download-repo-dir
- Owner: aztack
- Created: 2018-06-28T09:47:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T06:29:03.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T18:07:35.941Z (16 days ago)
- Topics: bitbucket, download, git, github, gitlab, repository
- Language: JavaScript
- Size: 50.8 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A Tool for Downloading Directory from Git Repository
# Install
```bash
npm i -g dl-repo-dir
```# Command line usage
```bash
# 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)`
```js
const downloadRepoDir = require('dl-repo-dir').downloadRepoDirconsole.log(`Downloading ${repo}/${dir} into ${saveTo}...`)
downloadRepoDir(repo, dir, saveTo, function (data) {
process.stdout.write(`\rDownloaded ${(data.percent*100).toFixed(1)}% `)
}, function (srcDir, destDir) {
return false; // return false to stop moving srcDir to destDir
}).then(function () {
process.stdout.write(' Done!\n')
}).catch(function (e) {
console.log(e.message)
});
```# Changelog
- v1.0.4: add beforeMove calblack
# Thanks
To [flipxfx/download-git-repo](https://github.com/flipxfx/download-git-repo)
# License
MIT