create-clean
v1.1.3
Published
Create-Clean is a versatile development utility designed to help developers clean up and optimize their projects.
Readme
Create-Clean
Create-Clean is a versatile development utility designed to help developers clean up and optimize their projects. It provides a variety of operations, such as removing local file references in README.md, deleting unnecessary files and folders (e.g., .DS_Store, node_modules), formatting code, and compressing image resources.
Table of Contents
Features
Clean Local File References in README.md:
- Removes links to local files (e.g.,
file://) from theREADME.mdfile.
- Removes links to local files (e.g.,
Delete
node_modulesFolder:- Recursively deletes the
node_modulesfolder to free up space.
- Recursively deletes the
Clean
.DS_StoreFiles:- Finds and removes all
.DS_Storefiles in the project directory.
- Finds and removes all
Clean Cache Folders:
- Deletes common cache folders like
.cacheand.tmp.
- Deletes common cache folders like
Auto-Format Code:
- Uses Prettier to format JavaScript, TypeScript, and JSON files.
Compress Images:
- Optimizes image files (
.jpg,.jpeg,.png) using imagemin.
- Optimizes image files (
Usage
To use this tool, ensure you have Node.js installed on your system. Then, run the tool directly:
npm init cleanYou will be presented with an interactive menu to select the desired operation.
Clean README.md
Removes local file references (e.g., file://) from the README.md file.
Example Output:
✔ Successfully cleaned README.mdDelete node_modules
Deletes the node_modules folder recursively.
Example Output:
✔ Successfully deleted node_modulesClean .DS_Store Files
Finds and removes all .DS_Store files in the project directory.
Example Output:
✔ Deleted: ./someFolder/.DS_Store
✔ Successfully cleaned 1 .DS_Store files.Clean Cache Folders
Deletes common cache folders like .cache and .tmp.
Example Output:
✔ Deleted: ./.cache
✔ Successfully cleaned 1 cache folders.Format Code
Automatically formats JavaScript, TypeScript, and JSON files using Prettier.
Example Output:
✔ Formatted: ./index.js
✔ Successfully formatted 1 code files.Compress Images
Optimizes image files (.jpg, .jpeg, .png) using imagemin.
Example Output:
✔ Compressed: ./images/example.jpg
✔ Successfully compressed 1 image files.Contributing
We welcome contributions! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Commit your changes (
git commit -m "Add some feature"). - Push the branch (
git push origin feature/your-feature-name). - Open a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
If you encounter any issues or have suggestions for improvement, feel free to open an issue or contact us.
希望这份简化的 README.md 能够满足您的需求!如果有其他补充或修改需求,请随时告知。
