JSPM

unused-dependencies-remover

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

    A developer's spring cleaning CLI tool to detect and remove unused files and code

    Package Exports

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

      Readme

      ๐Ÿงน unused-dependencies-remover

      A developer's spring cleaning CLI tool that detects and removes unused files and code from your projects.

      Project Cleanup CLI

      Features

      • ๐Ÿ” Smart Detection: Identifies unused images, styles, components, and code
      • ๐Ÿงช Safe Cleanup: Provides confidence scores and interactive confirmation before removal
      • ๐Ÿ“Š Detailed Reports: Generates comprehensive reports in JSON or Markdown
      • ๐Ÿ›ก๏ธ Git Safety: Option to only clean files that are committed to git
      • ๐Ÿ”ง Configurable: Exclude patterns, confidence thresholds, and more

      Installation

      # Install globally
      npm install -g unused-dependencies-remover
      
      # Or run directly with npx
      npx unused-dependencies-remover

      Usage

      Basic Scanning

      # Scan the current directory
      unused-dependencies-remover
      
      # Scan a specific directory
      unused-dependencies-remover --path ./my-project

      Cleanup Options

      # Dry run (simulate cleanup without removing files)
      unused-dependencies-remover --dry-run
      
      # Interactive cleanup (with confirmation)
      unused-dependencies-remover --clean
      
      # Non-interactive cleanup (use with caution!)
      unused-dependencies-remover --clean --no-interactive

      Filtering

      # Only scan specific types
      unused-dependencies-remover --only "images,styles"
      
      # Exclude specific patterns
      unused-dependencies-remover --exclude "test/**,*.spec.js,assets/vendor/**"

      Reporting

      # Generate a Markdown report
      unused-dependencies-remover --report cleanup-report.md
      
      # Generate a JSON report
      unused-dependencies-remover --report cleanup-report.json

      Advanced Options

      # Set confidence threshold (default: 70%)
      unused-dependencies-remover --threshold 80
      
      # Git safety mode (only suggest committed files)
      unused-dependencies-remover --git-safe
      
      # Custom ignore file
      unused-dependencies-remover --ignore-file .mycleanupignore

      Configuration

      You can create a .cleanupignore file in your project root to specify patterns to ignore:

      # Ignore these patterns
      dist/**
      build/**
      node_modules/**
      **/*.min.js
      assets/required/**

      Example Output

      ๐Ÿงน unused-dependencies-remover โ€” A Developer's Spring Cleaning CLI Tool
      v0.1.0
      โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      
      ๐Ÿ“Š Scan Results:
      โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
      
      ๐Ÿ–ผ๏ธ  Images & Media:
        โœ… assets/old-logo.png (95%)
        โœ… assets/unused-image.jpg (90%)
        โ” assets/background.png (65%)
      
      ๐ŸŽจ Style Files:
        โœ… styles/unused.css (85%)
        โœ… styles/temp.scss (90%)
      
      ๐Ÿ“œ Scripts:
        โœ… utils/deprecated.js (95%)
        โ” components/test.js (60%)
      
      ๐Ÿ“‹ Summary:
      โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
        5 files can likely be removed
        3 unused exports detected
        2 items below confidence threshold (70%)
      
      ๐Ÿ’ก Tip: Run with --clean to remove items, or --report report.md to save findings.

      License

      MIT