git-ripper 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -64
- package/package.json +1 -1
- package/src/index.js +1 -1
package/README.md
CHANGED
|
@@ -1,57 +1,70 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Git-ripper
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/git-
|
|
6
|
-
[](https://github.com/
|
|
5
|
+
[](https://www.npmjs.com/package/git-ripper)
|
|
6
|
+
[](https://github.com/sairajB/git-ripper/blob/main/LICENSE)
|
|
7
7
|
[](https://www.npmjs.com/package/git-ripper)
|
|
8
|
+
[](https://github.com/sairajB/git-ripper/issues)
|
|
9
|
+
[](https://github.com/sairajB/git-ripper/stargazers)
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
**Download specific folders from GitHub repositories without cloning the entire codebase**
|
|
10
12
|
|
|
11
13
|
[Installation](#installation) •
|
|
12
14
|
[Usage](#usage) •
|
|
13
15
|
[Features](#features) •
|
|
14
16
|
[Examples](#examples) •
|
|
15
|
-
[
|
|
17
|
+
[Configuration](#configuration) •
|
|
18
|
+
[Troubleshooting](#troubleshooting) •
|
|
19
|
+
[Contributing](#contributing) •
|
|
20
|
+
[License](#license)
|
|
16
21
|
|
|
17
22
|
</div>
|
|
18
23
|
|
|
19
|
-
##
|
|
24
|
+
## Why Git-ripper?
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
Have you ever needed just a single component from a massive repository? Or wanted to reference a specific configuration directory without downloading gigabytes of code? Git-ripper solves this problem by letting you extract and download only the folders you need, saving bandwidth, time, and disk space.
|
|
22
27
|
|
|
23
|
-
##
|
|
28
|
+
## Features
|
|
24
29
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
30
|
+
- **Selective Downloads**: Fetch specific folders instead of entire repositories
|
|
31
|
+
- **Directory Structure**: Preserves complete folder structure
|
|
32
|
+
- **Custom Output**: Specify your preferred output directory
|
|
33
|
+
- **Branch Support**: Works with any branch, not just the default one
|
|
34
|
+
- **Simple Interface**: Clean, intuitive command-line experience
|
|
35
|
+
- **Lightweight**: Minimal dependencies and fast execution
|
|
36
|
+
- **No Authentication**: Works with public repositories without requiring credentials
|
|
32
37
|
|
|
33
|
-
##
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
### Global Installation (Recommended)
|
|
34
41
|
|
|
35
42
|
```bash
|
|
36
|
-
# Install globally
|
|
37
43
|
npm install -g git-ripper
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This installs Git-ripper as a global command-line tool accessible from anywhere in your terminal.
|
|
38
47
|
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
### On-demand Usage
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx git-ripper <github-folder-url>
|
|
41
52
|
```
|
|
42
53
|
|
|
43
|
-
|
|
54
|
+
Run Git-ripper directly without installation using `npx`.
|
|
44
55
|
|
|
45
|
-
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
### Basic Command
|
|
46
59
|
|
|
47
60
|
```bash
|
|
48
|
-
git-ripper https://github.com/
|
|
61
|
+
git-ripper https://github.com/username/repository/tree/branch/folder
|
|
49
62
|
```
|
|
50
63
|
|
|
51
|
-
### With Output Directory
|
|
64
|
+
### With Custom Output Directory
|
|
52
65
|
|
|
53
66
|
```bash
|
|
54
|
-
git-ripper https://github.com/
|
|
67
|
+
git-ripper https://github.com/username/repository/tree/branch/folder -o ./my-output-folder
|
|
55
68
|
```
|
|
56
69
|
|
|
57
70
|
### Command Line Options
|
|
@@ -62,38 +75,80 @@ git-ripper https://github.com/sairajB/git-ripper/tree/main/src -o ripped-folder
|
|
|
62
75
|
| `-V, --version` | Show version number | - |
|
|
63
76
|
| `-h, --help` | Show help | - |
|
|
64
77
|
|
|
65
|
-
##
|
|
78
|
+
## Examples
|
|
79
|
+
|
|
80
|
+
### Extract a Component Library
|
|
66
81
|
|
|
67
|
-
### Download a React Component Library
|
|
68
82
|
```bash
|
|
83
|
+
# Download React DOM package
|
|
69
84
|
git-ripper https://github.com/facebook/react/tree/main/packages/react-dom
|
|
70
85
|
```
|
|
71
86
|
|
|
72
|
-
###
|
|
87
|
+
### Get Configuration Files
|
|
88
|
+
|
|
73
89
|
```bash
|
|
74
|
-
|
|
90
|
+
# Extract VS Code build configuration
|
|
91
|
+
git-ripper https://github.com/microsoft/vscode/tree/main/build -o ./vscode-build-config
|
|
75
92
|
```
|
|
76
93
|
|
|
77
94
|
### Download Documentation
|
|
95
|
+
|
|
78
96
|
```bash
|
|
97
|
+
# Get Node.js documentation
|
|
79
98
|
git-ripper https://github.com/nodejs/node/tree/main/doc -o ./node-docs
|
|
80
99
|
```
|
|
81
100
|
|
|
82
|
-
|
|
101
|
+
### Copy UI Templates
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Extract Tailwind components
|
|
105
|
+
git-ripper https://github.com/tailwindlabs/tailwindcss/tree/master/src/components -o ./tailwind-components
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## How It Works
|
|
109
|
+
|
|
110
|
+
Git-ripper operates in four stages:
|
|
111
|
+
|
|
112
|
+
1. **URL Parsing**: Extracts repository owner, name, branch, and target folder path
|
|
113
|
+
2. **API Request**: Uses GitHub's API to fetch the folder structure
|
|
114
|
+
3. **Content Download**: Retrieves each file individually while maintaining directory structure
|
|
115
|
+
4. **Local Storage**: Saves files to your specified output directory
|
|
116
|
+
|
|
117
|
+
## Configuration
|
|
118
|
+
|
|
119
|
+
Git-ripper works out of the box without configuration. For rate-limited GitHub API usage, authentication support is under development.
|
|
120
|
+
|
|
121
|
+
## Troubleshooting
|
|
122
|
+
|
|
123
|
+
### Common Issues
|
|
124
|
+
|
|
125
|
+
#### Rate Limit Exceeded
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
Error: Request failed with status code 403
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Solution**: GitHub limits unauthenticated API requests. Wait a few minutes and try again.
|
|
132
|
+
|
|
133
|
+
#### Invalid URL Format
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
Error: Invalid GitHub URL format
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Solution**: Ensure your URL follows the pattern: `https://github.com/owner/repo/tree/branch/folder`
|
|
83
140
|
|
|
84
|
-
|
|
85
|
-
- Repository owner
|
|
86
|
-
- Repository name
|
|
87
|
-
- Branch name (defaults to 'main')
|
|
88
|
-
- Target folder path
|
|
141
|
+
#### Folder Not Found
|
|
89
142
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
143
|
+
```
|
|
144
|
+
Error: Path not found in repository
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Solution**: Verify the folder path exists in the specified branch and repository.
|
|
93
148
|
|
|
94
|
-
##
|
|
149
|
+
## Contributing
|
|
95
150
|
|
|
96
|
-
Contributions
|
|
151
|
+
Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions to Git-ripper are **greatly appreciated**.
|
|
97
152
|
|
|
98
153
|
1. Fork the repository
|
|
99
154
|
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
@@ -101,39 +156,29 @@ Contributions are always welcome! Here's how you can help:
|
|
|
101
156
|
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
102
157
|
5. Open a Pull Request
|
|
103
158
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
107
|
-
|
|
108
|
-
## 🐛 Troubleshooting
|
|
109
|
-
|
|
110
|
-
### Rate Limiting
|
|
111
|
-
If you encounter rate limiting issues with the GitHub API, you can:
|
|
112
|
-
- Wait and try again later
|
|
113
|
-
- Use a GitHub token (coming soon)
|
|
159
|
+
See the [open issues](https://github.com/sairajB/git-ripper/issues) for a list of proposed features and known issues.
|
|
114
160
|
|
|
115
|
-
|
|
161
|
+
## Roadmap
|
|
116
162
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
163
|
+
- [ ] Add GitHub token authentication
|
|
164
|
+
- [ ] Support for GitLab and Bitbucket repositories
|
|
165
|
+
- [ ] Download from specific commits or tags
|
|
166
|
+
- [ ] Dry run mode
|
|
167
|
+
- [ ] File filtering options
|
|
168
|
+
- [ ] CLI interactive mode
|
|
120
169
|
|
|
121
|
-
|
|
122
|
-
- Verify the folder path is correct
|
|
123
|
-
- Check if the branch name is correct
|
|
170
|
+
## License
|
|
124
171
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
- Thanks to GitHub for providing the API
|
|
128
|
-
- Inspired by the need to download specific folders without cloning entire repositories
|
|
172
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
129
173
|
|
|
130
|
-
##
|
|
174
|
+
## Acknowledgments
|
|
131
175
|
|
|
132
|
-
-
|
|
133
|
-
-
|
|
176
|
+
- GitHub API for making this tool possible
|
|
177
|
+
- Everyone who has provided feedback and suggestions
|
|
134
178
|
|
|
135
179
|
---
|
|
136
180
|
|
|
137
181
|
<div align="center">
|
|
138
|
-
Made with ❤️ by sairajB
|
|
182
|
+
<p>Made with ❤️ by <a href="https://github.com/sairajB">sairajB</a></p>
|
|
183
|
+
<p>If you find this tool useful, consider <a href="https://github.com/sponsors/sairajB">sponsoring</a> its development</p>
|
|
139
184
|
</div>
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const { downloadFolder } = require('./downloader');
|
|
|
4
4
|
|
|
5
5
|
const initializeCLI = () => {
|
|
6
6
|
program
|
|
7
|
-
.version('1.
|
|
7
|
+
.version('1.1.2')
|
|
8
8
|
.description('Clone specific folders from GitHub repositories')
|
|
9
9
|
.argument('<url>', 'GitHub URL of the folder to clone')
|
|
10
10
|
.option('-o, --output <directory>', 'Output directory', process.cwd())
|