You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 11, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+21-6Lines changed: 21 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,26 +8,41 @@ This project allows you to download any folder inside a repo on github.
8
8
9
9
You need to have installed latest node, git, npm
10
10
11
-
## Initialization
11
+
## Installation
12
12
13
-
Execute this:
13
+
### From GitHub NPM Registry
14
+
15
+
1.[Generate `Personal access token (classic)` with `read:packages` scope](https://github.com/settings/tokens/new?description=Install%20packages%20from%20GitHub%20NPM%20registry&scopes=read:packages&default_expires_at=none)
16
+
2. Save the token
17
+
3. Run `npm login --auth-type=legacy --registry=https://npm.pkg.github.com` (read more about `--auth-type=legacy`[here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token))
18
+
4. Enter your username when asked
19
+
5. Paste the token as password value
20
+
6. Then run `npm i @nikelborm/download-github-folder` to install the package
21
+
22
+
### From default NPM registry
23
+
24
+
Currently in despute with NPM's support over publishing it as `download-github-folder`
25
+
26
+
### For local development
14
27
15
28
```bash
16
29
# Clone this repo:
17
-
git clone -b main --depth 1 https://github.com/nikelborm/download-github-folder.git
30
+
git clone -b main https://github.com/nikelborm/download-github-folder.git
sed -i "s/\(GITHUB_ACCESS_TOKEN\)='.*'/\1='$gh_token'/" .env
24
41
```
25
42
26
-
Then [get personal github access token here](https://github.com/settings/tokens)
27
-
28
43
## Environment Variables
29
44
30
-
-`GITHUB_ACCESS_TOKEN`: This is your personal access token from GitHub. It is used to authenticate your requests to the GitHub API. You can generate one from your GitHub account settings.
45
+
-`GITHUB_ACCESS_TOKEN`: This is your personal access token from GitHub. It is used to authenticate your requests to the GitHub API. You can generate one [here](https://github.com/settings/tokens/new?description=Read%20repo%20contents%20access%20to%20download-github-folder&scopes=public_repo&default_expires_at=none).
31
46
-`GITHUB_REPO_OWNER`: This is the username of the owner of the repository you are trying to download from. For example, if the repository's URL is `https://github.com/apache/superset`, the owner is `apache`.
32
47
-`GITHUB_REPO_NAME`: This is the name of the repository you are trying to download from. In the example above, the repository name is `superset`.
33
48
-`PATH_TO_DIRECTORY_IN_REPO`: This is the path to the directory you want to download. It can be directory that lies inside root of repo like `docker` or it can be some nested directory like `docker/nginx`.
Copy file name to clipboardExpand all lines: template.env
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Get here: https://github.com/settings/tokens
1
+
# Get here: https://github.com/settings/tokens/new?description=Read%20repo%20contents%20access%20to%20download-github-folder&scopes=public_repo&default_expires_at=none
0 commit comments