1.1.8 • Published 6 months ago

clean-unused-images v1.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

🗑️ 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:

  1. Fork the repository on GitHub.
  2. Create a new branch for your feature or bug fix.
  3. Commit your changes with a descriptive message.
  4. 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.

1.1.8

6 months ago

1.1.7

6 months ago

1.1.6

6 months ago

1.1.5

6 months ago

1.1.4

6 months ago

1.1.3

6 months ago

1.1.2

6 months ago

1.1.1

6 months ago

1.1.0

7 months ago

1.0.30

7 months ago

1.0.29

7 months ago

1.0.28

7 months ago

1.0.27

7 months ago

1.0.26

7 months ago

1.0.25

7 months ago

1.0.24

7 months ago

1.0.23

7 months ago

1.0.22

7 months ago

1.0.21

7 months ago

1.0.20

7 months ago

1.0.19

7 months ago

1.0.18

7 months ago

1.0.17

7 months ago

1.0.16

7 months ago

1.0.15

7 months ago

1.0.14

7 months ago

1.0.13

7 months ago

1.0.12

7 months ago

1.0.11

7 months ago

1.0.10

7 months ago

1.0.9

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago