# 🧹 node-cleaner

[![npm version](https://img.shields.io/npm/v/@happyvibess/node-cleaner.svg?style=flat-square)](https://www.npmjs.com/package/@happyvibess/node-cleaner)
[![npm downloads](https://img.shields.io/npm/dm/@happyvibess/node-cleaner.svg?style=flat-square)](https://www.npmjs.com/package/@happyvibess/node-cleaner)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)

> 🚀 A beautiful CLI tool to find and clean node_modules directories and free up disk space

```
╭─────────────────────────────────────────╮
│                                         │
│   🧹 Node Cleaner v1.2.0                │
│   Free up space by removing node_modules│
│                                         │
╰─────────────────────────────────────────╯

✨ Scanning for node_modules directories...
✔ Found 3 node_modules directories

📊 Space usage summary:
   ├─ /project1/node_modules (156.2 MB)
   ├─ /project2/node_modules (89.4 MB)
   └─ /project3/node_modules (124.8 MB)

   Total space used: 370.4 MB

? Select directories to clean: (Press <space> to select)
❯ ◻ /project1/node_modules
  ◻ /project2/node_modules
  ◻ /project3/node_modules

```

## ✨ Features

- 🔍 Smart scanning for node_modules directories
- 📊 Interactive selection with directory sizes
- 🎯 Customizable scan depth
- 🚀 Lightning-fast cleaning
- 📈 Detailed space usage statistics
- ⚡️ Progress bars and beautiful UI
- ✅ Safe deletion with confirmation

## 🚀 Installation

```bash
# Install globally (recommended)
npm install -g @happyvibess/node-cleaner

# Or use with npx
npx @happyvibess/node-cleaner
```

## 💻 Usage

```bash
# Basic usage (scans current directory)
node-cleaner

# Scan specific directory
node-cleaner -p /path/to/directory

# Set maximum scan depth (default: 4)
node-cleaner -d 5

# Skip confirmation (use with caution)
node-cleaner -f
```

## 🛠 Options

| Option | Description | Default |
|--------|-------------|---------|
| `-p, --path <path>` | Directory to scan | Current directory |
| `-d, --depth <number>` | Maximum depth to scan | 4 |
| `-f, --force` | Skip confirmation | false |
| `-v, --version` | Show version | - |
| `-h, --help` | Show help | - |

## 🌟 Example Output

```
Cleaning |██████████████████████████████| 100% || 3/3 directories

✨ Cleanup complete!

3 directories cleaned
Your project is now lighter and faster
Total space freed: 370.4 MB
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome!

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

## ☕ Support

If you find this tool helpful, you can support its development by buying me a coffee!

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/happyvibess)

## 📝 License

This project is [MIT](LICENSE) licensed.

---

<p align="center">Made with ❤️ by <a href="https://github.com/happyvibess">happyvibess</a></p>
