nmcleaner
v3.0.3
Published
this package will clean all node_module in dir
Maintainers
Readme
🧹 NM Cleaner
A powerful utility to clean up node_modules folders across your projects. Perfect for developers who want to free up disk space by removing unused node_modules directories.
✨ Features
- 🔍 Recursively finds all
node_modulesfolders in a directory - 💾 Shows the size of each
node_modulesfolder - 🗑️ Interactive deletion with confirmation prompts
- 📊 Summary of deleted folders and freed space
- 🛡️ Safe deletion with error handling
- 🎯 Target specific directories with path parameter
📦 Installation
# Install globally using npm
npm install -g nmcleaner
# Or install locally in your project
npm install nmcleaner🚀 Usage
Basic Usage
# If installed globally
nmcleaner
# If installed locally
npx nmcleaner
# Run in a specific directory
nmcleaner path=/path/to/your/projectsExample Output
Found 3 node_modules folders:
Delete node_modules at /path/to/project1/node_modules? (y/N)
Delete node_modules at /path/to/project2/node_modules? (y/N)
Delete node_modules at /path/to/project3/node_modules? (y/N)
✅ Deleted 2 folders. All done!🔧 Configuration
The utility accepts the following parameters:
path: Specify the target directory to scan (default: current directory)node index.js path=/Users/username/projects
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📝 License
This project is licensed under the ISC License.
🔍 How It Works
- The utility scans the current directory where the user executed nmcleaner if no specific path is provided, recursively checking for all subdirectories.
- It identifies all
node_modulesfolders - For each folder found:
- Shows the path along size in MB
- Asks for confirmation
- Deletes if confirmed
- Provides a summary of actions taken
