Package Exports
- git-ripper
- git-ripper/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (git-ripper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
📁 Git-ripper
Git-ripper is a lightweight CLI tool that lets you download specific folders from GitHub repositories without cloning the entire repo. Whether you need a single component from a large monorepo or a quick configuration file, Git-ripper saves time and bandwidth by fetching only what you need.
Installation • Usage • Features • Examples • Contributing
🚀 Features
- 📥 Download specific folders instead of entire repositories
- 🌳 Preserve complete folder structure
- 📂 Specify custom output directory
- 🔄 Works with any branch
- 💻 Simple command-line interface
- ⚡ Fast and lightweight
- 🔒 No authentication required for public repositories
📦 Installation
# Install globally
npm install -g git-ripper
# Or run with npx
npx git-ripper
🎯 Usage
Basic Usage
git-ripper https://github.com/sairajB/git-ripper/tree/main/src
With Output Directory
git-ripper https://github.com/sairajB/git-ripper/tree/main/src -o ripped-folder
Command Line Options
Option | Description | Default |
---|---|---|
-o, --output <directory> |
Specify output directory | Current directory |
-V, --version |
Show version number | - |
-h, --help |
Show help | - |
📝 Examples
Download a React Component Library
git-ripper https://github.com/facebook/react/tree/main/packages/react-dom
Download Configuration Files
git-ripper https://github.com/microsoft/vscode/tree/main/build -o ./build-config
Download Documentation
git-ripper https://github.com/nodejs/node/tree/main/doc -o ./node-docs
🔍 How It Works
Parses the provided GitHub URL to extract:
- Repository owner
- Repository name
- Branch name (defaults to 'main')
- Target folder path
Uses GitHub's API to fetch the folder structure
Downloads each file while maintaining the directory structure
Saves files to the specified output directory
🤝 Contributing
Contributions are always welcome! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🐛 Troubleshooting
Rate Limiting
If you encounter rate limiting issues with the GitHub API, you can:
- Wait and try again later
- Use a GitHub token (coming soon)
Common Issues
"Invalid URL" Error
- Make sure the URL follows the format:
https://github.com/owner/repo/tree/branch/folder
- Check if the repository and folder exist
- Make sure the URL follows the format:
"Path not found" Error
- Verify the folder path is correct
- Check if the branch name is correct
🙏 Acknowledgments
- Thanks to GitHub for providing the API
- Inspired by the need to download specific folders without cloning entire repositories
📬 Contact
- Create an issue in this repository
- Follow me on GitHub