dir-file-organizer
v1.0.0
Published
A simple CLI tool that automatically organizes files in a directory into categorized subfolders based on file extensions like images, documents, videos, audio, and more.
Readme
📁 File Organizer CLI Tool
A simple and effective CLI tool that automatically organizes files in a directory into categorized subfolders based on their file extensions — like images, documents, videos, audio, and more.
📦 Installation
Install globally via npm:
npm install -g dir-file-organizer🚀 Usage
organize <folder-path>Example:
organize ./downloadsThis will:
- Scan all files in the specified folder
- Categorize them based on type
- Move them into respective subfolders:
images/documents/videos/audios/archive-files/executable-files/code-files/
🧠 File Types Supported
The tool recognizes these file types:
📷 Images:
.jpg, .png, .webp, .svg, .ico, .jpeg, .gif, .bmp, .tiff, .heic, .avif, .raw
📄 Documents:
.pdf, .doc, .docx, .txt, .md, .csv, .pptx, .xlsx, .epub, etc.
🎬 Videos:
.mp4, .mkv, .webm, .mov, .avi, .flv, .mpeg, .ts, etc.
🎵 Audios:
.mp3, .wav, .ogg, .aac, .m4a, .flac, etc.
🗜️ Archive Files:
.zip, .rar, .7z, .tar, .gz, .xz, .bz2, .iso, .dmg
🧪 Executables:
.exe, .msi, .bat, .sh, .apk, .bin, .jar
👨💻 Code Files:
.js, .ts, .jsx, .py, .html, .css, .cpp, .java, .php, .sql, etc.
📁 Example Output
Before:
downloads/
├── image.jpg
├── video.mp4
├── resume.pdf
├── song.mp3
├── script.jsAfter:
downloads/
├── images/
│ └── image.jpg
├── videos/
│ └── video.mp4
├── documents/
│ └── resume.pdf
├── audios/
│ └── song.mp3
├── code-files/
│ └── script.js🙌 Author
Made with Node.js by Nitin
License: ISC
🛠️ Upcoming Features
--dry-runflag to preview file movements- Log file to record operations
- Undo feature
