Skip to content

About

A powerful Bash script to safely clean up node_modules directories and package-lock.json files from Node.js projects, featuring progress tracking, interactive confirmation, and detailed reporting.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

🗑️ Remove Node Modules Script

License: MIT Bash

A powerful and safe Bash script to clean up node_modules directories and package-lock.json files from your Node.js projects. Perfect for developers who want to free up disk space and start fresh with their dependencies.

✨ Features

  • 🔍 Smart Scanning: Recursively scans for node_modules directories and package-lock.json files
  • 📊 Detailed Summary: Provides a comprehensive overview of what will be removed
  • ⚠️ Safety First: Interactive confirmation before any deletion
  • 📈 Progress Tracking: Real-time progress bar during removal process
  • 📋 Completion Report: Detailed summary of successful and failed removals
  • 🚀 Fast & Efficient: Optimized for performance on large project structures

🚀 Quick Start

Prerequisites

  • Bash shell (Linux, macOS, or WSL on Windows)
  • Basic terminal knowledge

Installation

  1. Clone the repository:

    git clone https://github.com/RonakShishangia/remove-node-modules.git
    cd remove-node-modules
  2. Make the script executable:

    chmod +x remove_node_modules.sh

Usage

Run the script in your project root or any directory containing Node.js projects:

./remove_node_modules.sh

The script will:

  1. Scan the current directory and subdirectories
  2. Display a summary of found node_modules directories and package-lock.json files
  3. Ask for your confirmation
  4. Remove the files/directories with a progress bar
  5. Provide a completion report

📖 Example Output

╔══════════════════════════════════════════════════════════════╗
║                 NODE_MODULES REMOVAL SCRIPT                  ║
╚══════════════════════════════════════════════════════════════╝

🔍 Scanning for node_modules directories...
🔍 Scanning for package-lock.json files...

📊 SCAN RESULTS:
   Total node_modules directories found: 3
   Total package-lock.json files found: 2

📁 Directories to be removed:
   1) ./project1/node_modules
   2) ./project2/node_modules
   3) ./project3/node_modules

⚠️  WARNING: This will permanently delete the above directories and files!
   Continue with removal? (y/N): y

🗑️  REMOVING DIRECTORIES...
   Removing: ./project1/node_modules [####################] 100%
   ✅ Removed successfully
   ...

⚠️ Important Warning

This script permanently deletes files and directories. Always:

  • Backup important data before running
  • Double-check the scan results
  • Use in development environments only
  • Avoid running on production systems

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a 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

Development Setup

git clone https://github.com/RonakShishangia/remove-node-modules.git
cd remove-node-modules
# Make your changes
# Test thoroughly
# Submit PR

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Inspired by the common need to clean up Node.js project dependencies
  • Built with love for the developer community

Made with ❤️ by Ronak Shishangia

About

A powerful Bash script to safely clean up node_modules directories and package-lock.json files from Node.js projects, featuring progress tracking, interactive confirmation, and detailed reporting.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages