2.0.0 โข Published 5 months ago
delmodules v2.0.0
delmodules ๐๏ธ
A simple CLI tool to recursively clean up node_modules
directories in your Node.js projects. Written in TypeScript for better type safety and developer experience.
Features
- ๐ Finds and deletes
node_modules
directories - ๐ณ Optional recursive deletion with
--all
flag - ๐ Fast and efficient cleanup
- โก Easy to use
- ๐ Safe deletion process
- ๐ Written in TypeScript
- ๐ก๏ธ Type definitions included
- ๐งถ Yarn support
Installation
You can install the package using npm:
npm install -g delmodules
Or using yarn:
yarn global add delmodules
Or directly from GitHub:
# Using npm
npm install -g github:oktayparlak/delmodules
# Using yarn
yarn global add https://github.com/oktayparlak/delmodules.git
Repository
GitHub: https://github.com/oktayparlak/delmodules
Usage
Clean Current Directory Only
To delete the node_modules
directory in your current location:
delmodules
Clean All Subdirectories Recursively
To recursively delete all node_modules
directories in the current directory and all its subdirectories:
delmodules --all
Development
Prerequisites
- Node.js (>= 12.0.0)
- npm or yarn
Setup
- Clone the repository:
git clone https://github.com/oktayparlak/delmodules.git
cd delmodules
- Install dependencies:
# Using npm
npm install
# Using yarn
yarn install
Available Scripts
# Build the project
npm run build
# or
yarn build
# Development mode with watch
npm run dev
# or
yarn dev
# Clean build files
npm run clean
# or
yarn clean
# Start the compiled app
npm start
# or
yarn start
This will compile the TypeScript code to JavaScript in the dist
directory.
How It Works
Without
--all
flag:- Checks only the current directory for a
node_modules
folder - If found, safely deletes it
- Checks only the current directory for a
With
--all
flag:- Starts from the current directory
- Recursively scans all subdirectories
- Deletes each
node_modules
directory it finds - Notifies when the operation is complete
Types
Type definitions are included in the package. TypeScript users will get full type support when using this package.
License
MIT
Author
Oktay
Contributing
- Fork this repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'feat: Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request