npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vibe-janitor

v0.1.9

Published

A CLI tool that cleans AI-generated JavaScript/TypeScript projects efficiently and intelligently

Readme

vibe-janitor 🧹

✨ Features

  • 🧹 Smart Code Cleanup: Automatically detect and remove unused imports, variables, and functions left behind by AI tools like ChatGPT or Copilot. Keep only the code that actually matters.
  • 🖼️ Asset Scanner: Finds forgotten static files (images, fonts, CSS, etc.) that are no longer used. Great after a few wild rounds of prompt-based design changes.
  • 📊 Complexity Analyzer: Flags overly complex functions and deeply nested code—often the result of AI overthinking your prompts.
  • 📦 Dependency Checker: Detects unused npm packages and even circular dependencies introduced during AI-assisted coding sessions.
  • 🔍 Dry Run Mode: See what vibe-janitor would clean up without actually changing anything. Ideal for cautious coders and curious minds.
  • 📝 Insightful Reports: Generates human-readable and JSON reports of all cleanup actions. Perfect for reviewing the output of your AI-generated projects.

🚀 Installation

Global Installation

npm install -g vibe-janitor

Local Project Installation

npm install --save-dev vibe-janitor

Quick Try with npx

npx vibe-janitor

💻 Usage

Interactive Mode

By default, vibe-janitor runs in interactive mode when no options are provided:

npx vibe-janitor

This will prompt you with questions to configure the cleanup process:

  • Clean up unused imports and code automatically? (Y/n)
  • Show detailed information about issues found? (Y/n)
  • Generate detailed reports? (y/N)
  • Run advanced cleanup for assets, variables, and functions? (y/N)
  • Analyze package dependencies? (y/N)
  • Check for circular dependencies? (y/N)

To skip interactive mode, use the --no-interactive flag or provide specific options.

Basic Usage

# Analyze current directory without making changes
vibe-janitor --dry-run

# Get detailed list of unused imports and other issues
vibe-janitor --list

# Remove unused imports and code
vibe-janitor --remove-unused

# Clean a specific directory
vibe-janitor ./path/to/project --remove-unused

Command Options

  --deep-scrub            Run all available cleanup routines
  --dry-run               Show what would be removed without deleting anything
  --remove-unused         Remove unused files, components, and imports
  --list                  List detailed information about unused imports and other issues
  --report [path]         Generate detailed reports (JSON and Markdown)
  --analyze-complexity    Analyze code complexity
  --analyze-dependencies  Analyze package dependencies
  --check-circular        Check for circular dependencies
  --generate-graph        Generate dependency graph visualization
  --log                   Output detailed cleanup logs
  --quiet                 No console output, just do the job
  --no-progress           Disable progress bars

Using in package.json scripts

{
  "scripts": {
    "clean": "vibe-janitor --list",
    "clean:fix": "vibe-janitor --remove-unused",
    "clean:deep": "vibe-janitor --deep-scrub --remove-unused"
  }
}

Detailed Mode Output

With the new --list option, you get detailed information about what needs to be cleaned:

📝 Cleanup Summary:
  - Unused imports: 33 across 22 files

    📋 Unused imports details:
    - components/Header.tsx (2 unused):
      • useState
      • useEffect
    - pages/index.tsx (3 unused):
      • Image
      • Head
      • styles
    ...

    💡 To fix these issues, run: npx vibe-janitor --remove-unused

🗂️ Generated Reports

Using the --report option generates detailed markdown and JSON reports:

vibe-janitor --report

This creates reports in the vibe-janitor-report/ directory:

  • vibe-janitor-report-main.md: Human-readable report
  • vibe-janitor-report-main.json: Machine-readable report
  • vibe-janitor-report-dependencies.md: Dependency analysis
  • vibe-janitor-report-circular.md: Circular dependency analysis

🛠️ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0) - see the LICENSE file for details.

This license ensures that while the software remains open source, any derivative works must also be distributed under the same license terms, giving you as the original author more control over how your work is used and modified.

🙏 Acknowledgments

Big thanks to the open-source tools that make vibe-janitor possible:

  • 🧠 TypeScript — for the powerful Compiler API that lets us deeply understand your code
  • 🧬 ts-morph — for making AST manipulation feel almost natural
  • 🧰 depcheck — for digging through dependencies like a true janitor