Dead Modules is a CLI tool written in Go to search for and remove old node_modules directories within a working directory. It provides an interactive terminal interface to list, select, and delete these directories, helping you clean up disk space and manage your project dependencies more effectively.
- Interactive CLI: Provides a user-friendly terminal interface using the
tviewpackage. - Directory Scanning: Recursively searches for
node_modulesdirectories within the working root directory. - Selection and Deletion: Allows users to select directories and delete them interactively.
- Dynamic Sorting: Lists directories sorted by their last modified date.
- Status Updates: Displays status messages and updates in real-time during the search and deletion processes.
-
Add brew tap
brew tap furkando/tap
-
Install the Application
brew install dead_modules
-
Run the Application
dead_modules
-
Clone the Repository
git clone https://github.com/furkando/dead_modules.git cd dead_modules -
Build the Project Ensure you have Go installed. If not, download and install it from golang.org.
go build -o dead_modules
-
Run the Application
./dead_modules
Run the application in your terminal:
./dead_modules- Search for Directories: The application starts by prompting you to search for
node_modulesdirectories. PressEnterto begin the search. - View Results: Directories are listed in a table, sorted by their last modified date.
- Select Directories: Use the arrow keys to navigate the list. Press
Spaceto select or deselect a directory. - Delete Selected Directories: Press
Enterto delete the selected directories. The status will update to show[DELETING]and[DELETED]messages. - Quit the Application: Press
qto quit the application at any time.
- [yellow]Searching...: Indicates that the application is currently searching for
node_modulesdirectories. - [yellow][Deleting]: Indicates that the application is currently deleting the specified directory.
- [green][DELETED]: Indicates that the specified directory has been successfully deleted.
- [red]Error: Indicates an error occurred during the deletion process.
- main.go: Entry point of the application.
- ui/ui.go: Handles the user interface setup and interactions.
- ui/table.go: Manages the table display and updates.
- search/search.go: Contains the logic for searching
node_modulesdirectories. - delete/delete.go: Contains the logic for deleting the selected directories.
Below is a sample terminal session using Dead Modules CLI Tool:
$ dead_modules-
On startup, you will see the prompt:
Dead Modules v1.0.3 Press Enter to start searching for node_modules... -
After pressing
Enter, the search begins and results are displayed in a table. -
Use the arrow keys to navigate,
Spaceto select/deselect, andEnterto delete.
To enable debugging mode, add the -debug flag when running the application:
./dead_modules -debugContributions are welcome! Please feel free to submit a pull request or open an issue if you have suggestions or bug reports.
This project is licensed under the MIT License - see the LICENSE file for details.
