| layout | default |
|---|---|
| title | πΎ husky-image-guard - Keep Your Repository Clean and Fast |
| description | πΌοΈ Ensure optimal image sizes with Husky Image Guard. Automatically block oversized images before Git pushes to keep your repository clean and efficient. |
Welcome to husky-image-guard! This tool helps you check image sizes before pushing files to your Git repository. It prevents large images from being uploaded, ensuring your repo stays efficient and easy to manage.
Before you begin, ensure your environment meets the following requirements:
- Operating System: Windows, macOS, or Linux
- Git: Installed on your computer. You can download it from git-scm.com.
- Node.js: Required for proper functionality. Download it from nodejs.org.
To download husky-image-guard, follow these simple steps:
-
Visit the Download Page
Go to the following link to access the.Release page:
Download husky-image-guard. -
Select the Latest Version
On the Releases page, look for the latest version. It will usually be at the top of the list. -
Download the Installation File
Under the latest version, find the installation file suitable for your operating system. Click the link to download it. -
Install husky-image-guard
Once the file downloads, locate it on your computer. Open the file and follow the installation instructions. Typically, you will need to agree to the terms and follow the prompts to complete the installation. -
Verify Installation
Open a terminal or command prompt and type:husky-image-guard --versionThis will show you the installed version, confirming the installation was successful.
Once installed, husky-image-guard works seamlessly with Git. Hereβs how to use it:
-
Navigate to Your Project Folder
Open your terminal or command prompt. Use thecdcommand to move to the folder of your project. -
Set Up Husky
Run the following command to set up Husky in your project:npx husky install -
Add Husky Hook
Next, add the husky-image-guard hook by running:npx husky add .husky/pre-push "husky-image-guard"This command will make sure husky-image-guard checks your images before a push.
-
Test the Setup
Now, try to push an image file. If the image is too large, husky-image-guard will prevent the push and display a helpful message.
- Image Size Check: Block images that exceed your specified size limit.
- Easy Setup: Install and configure in just a few minutes.
- Log Messages: Clear messages let you know why an image was blocked.
You can customize husky-image-guard by setting your preferred image size limits. Open the configuration file, often named .husky-image-guard.json, and add the following:
{
"maxSize": "2MB"
}Replace "2MB" with your desired limit. This will restrict images larger than this size from being pushed.
If you run into issues, consider the following steps:
- Check Git Installation: Ensure that Git is installed and accessible in your terminal.
- Verify Node.js: Make sure Node.js is running correctly. You can check by typing
node -v. - Configuration File: Double-check the
.husky-image-guard.jsonfor correct syntax.
If problems persist, feel free to open an issue on our GitHub Issues page.
Want to help improve husky-image-guard? Contributions are welcome! Please submit your changes via pull requests. Before you start coding, check the issues to see where help is needed.
This project is licensed under the MIT License. See the LICENSE file for details.
For any further questions, please open an issue on GitHub or reach out to the repository maintainer. Happy coding!