https://github.com/typicalninja/download-github-files
Download Individual Directories from github easy and fast
https://github.com/typicalninja/download-github-files
download download-directory downloader downloader-for-github github javascript react typescript
Last synced: 3 months ago
JSON representation
Download Individual Directories from github easy and fast
- Host: GitHub
- URL: https://github.com/typicalninja/download-github-files
- Owner: typicalninja
- License: gpl-3.0
- Created: 2023-07-20T18:20:19.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-25T13:07:28.000Z (over 2 years ago)
- Last Synced: 2023-12-16T15:44:13.569Z (over 2 years ago)
- Topics: download, download-directory, downloader, downloader-for-github, github, javascript, react, typescript
- Language: TypeScript
- Homepage: https://typicalninja.github.io/download-github-files/
- Size: 3.16 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# 📂 download-github-files
[](https://www.codefactor.io/repository/github/typicalninja/download-github-files)
Download **Individual** 📂 Directories from github. By default github only allows you to download the whole repository. This becomes a issue when you are trying to download
only a small portion of the repository of a large repository. This tool allows you to download what you need and even filter out the files you will download with [globs](https://en.wikipedia.org/wiki/Glob_(programming)) (Note: only available with [downloader mode **1**](#downloader-modes))
> This is a web only project, you can use **git** (require some amount of knowledge) to do this on your own.
# ✨ Features
* Elegant ui powered by [mantine](https://mantine.dev) & React 💻
* [Control panel to customize your experience](#⚙️-settings-panel-overview) ⚙️
* Fast downloads ⚡️
* Filter and only download the files you need ([Only with mode **1**](#downloader-modes)), powered by [minimatch](https://github.com/isaacs/minimatch/tree/main) 📋
* Automatic zip file generation 📦
* Support downloading of private repositories 🔒 ([*](#limitation-on-private-repositories))
* Download large directories 📂 ([*](#limitation-on-large-repositories))
# 🚀 Demo
Click on any of the demo links to try it out.
* [Download With Nested Directories](https://typicalninja.github.io/download-github-files/d?resolve=https://github.com/typicalninja/tweets.ts/tree/main/docs)
* [Download of large amount of files](https://typicalninja.github.io/download-github-files/d?resolve=https://github.com/umami-software/umami/tree/master/public/images/flags)
* [Even larger amount of files](https://typicalninja.github.io/download-github-files/d?resolve=https://github.com/torvalds/linux/tree/master/fs)
## ⚙️ Settings Panel overview
### Github token

The downloader requires a personal access token to be added to the settings panel to view private repositories. this also allows you to have **Higher** api limits.
> [Click here to generate a personal access token](https://github.com/settings/tokens/new?description=Download%20Github%20Files&scopes=repo)
> [Fine grained access tokens also work](https://github.com/settings/tokens?type=beta)
After generating a token, paste the token into the input, make sure "Use Token for requests" is ticked and click Test token

If all is good following notification should appear (if not check if you mistyped)

### Downloader Modes
There are currently 3 Downloader modes,
1. Fetch repo and file list - Give the full control to you, the downloader will only fetch the repo and file list and wait for you to click "fetch..." button to continue
2. Fetch repo and Download Files - One step further than 1st mode. on this mode the downloader will download and keep the zip file in memory instead of prompting for saving
3. Fetch repo and Download & Save Files - Download will start on visiting the site and save prompt will appear automatically
## ⚠️ Limitations
#### API Limits
* This tool utilizes the GitHub API to retrieve file lists and their content. As with any API, there are limits. By default, the tool operates in ****Guest** mode, which may have lower API limits.
* If you desire a higher API limit, [create a GitHub personal token](https://github.com/settings/tokens/new?description=Download%20Github%20Files&scopes=repo) and
[add it to the settings panel](#github-token) of the downloader. **Remember to refresh the page** after adding the token.
#### Limitation on Private Repositories
* The downloader requires a personal access token to be [added to the settings panel]((#settings-panel-overview)) to view any private repository
> [Click here to generate a personal access token](https://github.com/settings/tokens/new?description=Download%20Github%20Files&scopes=repo)
> [Fine grained access tokens also work](https://github.com/settings/tokens?type=beta)
#### Limitation on Large repositories
Only tested limits for large repositories is the [linux kernel repo](https://github.com/torvalds/linux/tree/master/fs) of [2156 Files with total size 42.9 MB](https://typicalninja.github.io/download-github-files/d?resolve=https://github.com/torvalds/linux/tree/master/fs). While even larger amounts are theoretically possible, are not guaranteed. The tool's performance may vary depending on the size and complexity of the repository being accessed.
## Credits
#### Packages used
* [react](https://react.dev/)
* [mantine ui](https://mantine.dev) - ui
* [fflate](https://github.com/101arrowz/fflate) - Zip file creation
* [save-file](https://github.com/dy/save-file) - Save file in browser
* [p-map & p-retry](https://github.com/sindresorhus/p-map) - promise based stuff
* [minimatch](https://github.com/isaacs/minimatch/tree/main) - use in the filter to check file path with glob support
#### Inspiration
* [download-directory.github.io](https://download-directory.github.io) - Direct Inspiration for this project
# License
GNU General Public License v3.0 or later
See [LICENSE](./LICENSE) to see the full text.