clean-unused-images v1.1.8
🗑️ Clean Unused Images in React Projects
A Node.js CLI tool that scans your entire project, including public/
, to detect and manage unused images. You can either delete them permanently or move them to another folder for review.
🚀 Features
✅ Scans the entire project, including public/
and src/
.
✅ Detects image usage in JavaScript, TypeScript, CSS, SCSS, JSON, and HTML files.
✅ Safe Cleanup – Choose to delete or move unused images instead of blindly removing them.
✅ Ignore Specific Folders – Use the --ignore
option to exclude folders like node_modules
, dist
, etc.
✅ Custom Directory Scan – Scan only a specific folder instead of the entire project.
📌 Installation
1️⃣ Install Globally
Install it globally to use in any project:
npm install -g clean-unused-images
Or using Yarn:
yarn global add clean-unused-images
➡️ After installation, run the tool using:
npx clean-unused-images
2️⃣ Run Without Installation (Using NPX)
If you don't want to install it globally, you can run it directly:
npx clean-unused-images
🛠️ Usage
Scan for Unused Images
Run this command in your project root:
npx clean-unused-images
Ignore Specific Folders
Exclude folders like node_modules
, dist
, or build
using the --ignore
option:
npx clean-unused-images --ignore=node_modules,dist,build
Scan a Specific Folder
Limit the scan to a particular directory:
npx clean-unused-images --directory=src
Move Unused Images Instead of Deleting
Rather than deleting, move unused images to an unused-images/
folder for review. This option appears as a prompt when you run the tool.
⚠️ Important Notes
- The tool scans the entire project, including
public/
. - By default, it does not delete images inside
public/
, as they may be used in static files. - A confirmation prompt appears before deleting or moving images.
- For safety, consider using Git to track changes before running the tool.
🏢 Contributing
We welcome contributions! If you’d like to improve the tool:
- Fork the repository on GitHub.
- Create a new branch for your feature or bug fix.
- Commit your changes with a descriptive message.
- Push your branch and open a pull request.
🐝 License
This project is licensed under the MIT License. See the LICENSE
file for more details.
💡 Author
Developed with ❤️ by Prajal Bankoti.
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago