JSPM

cleanup-unused-images

1.1.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 2
    • Score
      100M100P100Q22946F
    • License MIT

    Tool to find and remove unused images in the project

    Package Exports

    • cleanup-unused-images
    • cleanup-unused-images/dist/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 (cleanup-unused-images) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Cleanup Unused Images

    A tool to find and delete unused image files in your project.

    🚀 Installation

    npm install -g cleanup-unused-images

    📖 Usage

    1. Direct Usage

    # Check unused images (without deletion)
    cleanup-images
    
    # Check and delete unused images
    cleanup-images -d
    
    # Specify project directory
    cleanup-images -p /path/to/project

    2. Integration with package.json

    {
      "scripts": {
        "cleanup": "cleanup-images",
        "cleanup:delete": "cleanup-images -d"
      }
    }

    3. Run script from package.json by npm or yarn

    npm run cleanup
    npm run cleanup:delete

    ⚙️ Options

    Option Description Default
    -d, --delete Delete unused image files false
    -p, --directory Path to project directory Current directory

    🖥️ Display Results

    // Results will be displayed in English
    {
        "Images tested": "100",
        "Unused images": "15",
        "Directory tested": "/project/path",
        "Processing status": "Completed"
    }

    ⚠️ Important Notes

    • Backup your project before running
    • Test without -d flag first
    • Carefully review the list of images to be deleted
    • Tool will search in files:
      • .tsx, .jsx, .js, .ts
      • .css, .scss
      • .html, .md

    🔍 Supported Image Formats

    • .png
    • .jpg, .jpeg
    • .gif
    • .webp
    • .svg
    • .ico

    📋 System Requirements

    • Node.js 14.x or higher
    • npm or yarn

    🐛 Troubleshooting

    If you encounter issues:

    1. Check directory permissions
    2. Ensure public directory exists
    3. Verify supported image formats
    4. Run without -d flag for debugging

    🤝 Contributing

    All contributions are welcome! Please create an issue or pull request.

    📄 License

    MIT

    📞 Support

    If you need help:

    • Create an issue on GitHub
    • Check existing issues
    • Read the documentation carefully

    💖 Donate

    If you find this tool helpful, you can support the development by donating:


    Made with ❤️ to keep your projects cleaner