Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phated/github-download-directory
Download the contents of a given directory from a repository on GitHub.
https://github.com/phated/github-download-directory
Last synced: 26 days ago
JSON representation
Download the contents of a given directory from a repository on GitHub.
- Host: GitHub
- URL: https://github.com/phated/github-download-directory
- Owner: phated
- License: mit
- Created: 2018-01-16T22:21:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-04-08T18:32:48.000Z (over 2 years ago)
- Last Synced: 2024-10-13T16:41:38.605Z (30 days ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 28
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# github-download-directory
Download the contents of a given directory from a repository on GitHub.
Only works in node 12+
## Usage
Best used from the command line:
```bash
> github-download-directory gulpjs/gulp docs
```Or programatic:
```js
var downloader = require('github-download-directory');downloader.download('gulpjs', 'gulp', 'docs').then(console.log, console.error);
```You can also construct a downloader instance:
```js
var { Downloader } = require('github-download-directory');// You can even include custom cache stores compatible with https://www.npmjs.com/package/keyv
var KeyvFile = require('keyv-file').KeyvFile;
var store = new KeyvFile();var custom = new Downloader({
cache: { store },
github: { auth: 'SOME_AUTH_TOKEN' },
});custom.download('gulpjs', 'gulp', 'docs').then(console.log, console.error);
```## License
MIT