Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit 3428dae

Browse files
committed
quick save: Fri May 9 18:16:57 MSK 2025
1 parent a76c9f0 commit 3428dae

File tree

1 file changed

+66
-16
lines changed

1 file changed

+66
-16
lines changed

README.md

Lines changed: 66 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,25 @@ It allows you to download any folder or a file from a repo on github.
5757

5858
## Installation
5959

60-
We support various installation options which you way want.
60+
We support various installation options. Regardless of what you choose, if you want to make
61+
CLIs written in JS run faster, I highly recommend adding this line to your `.bashrc`:
6162

62-
### Package with CLI and functions from [default NPM registry](https://www.npmjs.com/package/fetch-github-folder)
63+
```bash
64+
export NODE_COMPILE_CACHE=~/.cache/nodejs-compile-cache
65+
```
66+
67+
### Install package with CLI and functions from [default NPM registry](https://www.npmjs.com/package/fetch-github-folder)
6368

6469
```bash
6570
npm i fetch-github-folder
6671
```
6772

68-
### Package with only functions from [JSR](https://jsr.io/@nikelborm/fetch-github-folder)
73+
<details>
74+
<summary>
75+
76+
### Install package with only functions from [JSR](https://jsr.io/@nikelborm/fetch-github-folder)
77+
78+
</summary>
6979

7080
Unfortunately JSR doesn't support publishing executables yet, so you can install
7181
only script library with functions that will allow you to fetch github folder
@@ -75,7 +85,13 @@ from other scripts.
7585
npx jsr add @nikelborm/fetch-github-folder
7686
```
7787

78-
### Package with CLI and functions from [GitHub's NPM registry](https://github.com/nikelborm/fetch-github-folder/pkgs/npm/fetch-github-folder)
88+
</details>
89+
<details>
90+
<summary>
91+
92+
### Install package with CLI and functions from [GitHub's NPM registry](https://github.com/nikelborm/fetch-github-folder/pkgs/npm/fetch-github-folder)
93+
94+
</summary>
7995

8096
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)
8197
2. Login to Github's NPM registry (yes you need to do it, even if the package is public):
@@ -95,32 +111,52 @@ npx jsr add @nikelborm/fetch-github-folder
95111
npm i @nikelborm/fetch-github-folder
96112
```
97113

98-
### Package with CLI and functions from [Github Releases](https://github.com/nikelborm/fetch-github-folder/releases)
114+
</details>
115+
<details>
116+
<summary>
117+
118+
### Install package with CLI and functions from [Github Releases](https://github.com/nikelborm/fetch-github-folder/releases)
119+
120+
</summary>
99121

100122
```bash
101123
PACKAGE=fetch-github-folder
102124
125+
# Either set specific tag
103126
TAG=0.1.27 && npm i https://github.com/nikelborm/$PACKAGE/releases/download/$TAG/$PACKAGE.tgz
104-
# or
127+
# or download the latest
105128
npm i https://github.com/nikelborm/$PACKAGE/releases/latest/download/$PACKAGE.tgz
106129
```
107130

108-
### Only CLI directly into the system from [Github Releases](https://github.com/nikelborm/fetch-github-folder/releases)
131+
</details>
132+
<details open>
133+
<summary>
134+
135+
### Install only the CLI directly into the system from [Github Releases](https://github.com/nikelborm/fetch-github-folder/releases)
136+
137+
</summary>
109138

110139
```bash
111140
set -euo pipefail
112141
PACKAGE=fetch-github-folder
113142
114143
path_to_the_script=/usr/bin/$PACKAGE
115144
145+
# Either set specific tag
116146
TAG=0.1.27 && sudo curl -sLo $path_to_the_script https://github.com/nikelborm/$PACKAGE/releases/download/$TAG/$PACKAGE.js
117-
# or
147+
# or download the latest
118148
sudo curl -sLo $path_to_the_script https://github.com/nikelborm/$PACKAGE/releases/latest/download/$PACKAGE.js
119149
120150
sudo chmod +x $path_to_the_script
121151
```
122152

123-
### Local development
153+
</details>
154+
<details>
155+
<summary>
156+
157+
### Setup the repo for local development
158+
159+
</summary>
124160

125161
```bash
126162
git clone -b main [email protected]:nikelborm/fetch-github-folder.git
@@ -131,12 +167,7 @@ read -sp 'Enter github access token: ' gh_token; echo;
131167
sed -i "s/\(GITHUB_ACCESS_TOKEN\)='.*'/\1='$gh_token'/" .env
132168
```
133169

134-
Also it's recommended to add this string to your .bashrc, if you want faster
135-
CLIs written in JS
136-
137-
```bash
138-
export NODE_COMPILE_CACHE=~/.cache/nodejs-compile-cache
139-
```
170+
</details>
140171

141172
## Usage
142173

@@ -160,7 +191,7 @@ import {
160191

161192
### Execution of CLI installed with NPM
162193

163-
The easiest way to execute the CLI (preliminary installation is not required) is
194+
The **easiest way** to execute the CLI (preliminary installation is not required) is
164195
like this:
165196

166197
```bash
@@ -173,8 +204,13 @@ Also there's a shorter form available (preliminary installation is required):
173204
npx fgf --repoOwner apache --repoName superset
174205
```
175206
207+
<details>
208+
<summary>
209+
176210
### Non-interactive CLI execution on the fly from [Github Releases](https://github.com/nikelborm/fetch-github-folder/releases)
177211
212+
</summary>
213+
178214
If you already know the supported arguments (e.g. `--help` to print them all),
179215
you can pipe the bundled and minified script version into node directly and pass
180216
your arguments after `node -`:
@@ -187,8 +223,14 @@ TAG=0.1.27 && curl -sL https://github.com/nikelborm/$PACKAGE/releases/download/$
187223
curl -sL https://github.com/nikelborm/$PACKAGE/releases/latest/download/$PACKAGE.js | node - --repoOwner apache --repoName superset
188224
```
189225
226+
</details>
227+
<details>
228+
<summary>
229+
190230
### Interactive CLI execution from [Github Releases](https://github.com/nikelborm/fetch-github-folder/releases)
191231
232+
</summary>
233+
192234
The script also supports interactive mode (`--wizard`), where you will be asked
193235
to pass arguments sequentially and interactively. Since it requires user input,
194236
it can't be piped and needs to be saved to a temporary file:
@@ -205,12 +247,20 @@ node $tmp_js --wizard
205247
rm $tmp_js
206248
```
207249

250+
</details>
251+
<details open>
252+
<summary>
253+
208254
### Execution of CLI installed directly into the system
209255

256+
</summary>
257+
210258
```bash
211259
fetch-github-folder --repoOwner apache --repoName superset
212260
```
213261

262+
</details>
263+
214264
## Environment Variables
215265

216266
If you often use the CLI, you can permanently set the arguments via env

0 commit comments

Comments
 (0)