UNPKG

@happyvibess/node-cleaner

Version:

๐Ÿงน Interactive CLI tool to find and clean node_modules directories and free up space

115 lines (80 loc) โ€ข 3.47 kB
# ๐Ÿงน 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>