1.0.2 • Published 5 months ago

autosort v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

AutoSort

AutoSort is a powerful and intuitive command-line tool to organize files in a folder. Designed to be simple yet elegant, it provides flexible sorting options for files by name, extension, or creation date. With support for recursive folder sorting and real-time monitoring, AutoSort is the perfect tool to keep your files organized.


Features

  • Sort by File Type (Extension) (Default): Organize files based on their extensions.
  • Sort by Name: Organize files alphabetically by their first letter.
  • Sort by Creation Date: Group files based on their creation date.
  • Recursive Sorting: Sort files in all subdirectories with the --sub option.
  • Active Mode: Watch a folder for changes and sort files automatically with the --active option.
  • Dry Run: Simulate the sorting process to see what would happen without making changes.
  • Logging: Keep a detailed log of all actions performed.
  • Color-Coded Outputs: Intuitive and colorful output for clear feedback.
  • Cross-Platform: Works on Windows, macOS, and Linux.

Installation

Install via npm:

  1. Add through NPM:

    npm install autosort
  2. Run using default settings:

    autosort .

Usage

Run autosort followed by the folder you want to organize.

autosort /path/to/folder [options]

Options

OptionAliasDescription
--name-nSort files by their first letter.
--extension-eSort files by their file type (extension).
--date-dSort files by their creation date.
--sub-sSort files in all subdirectories recursively.
--active-aWatch the folder for changes and sort files automatically.
--drySimulate sorting without making changes.
--log-lGenerate a log file of actions taken.
--help-hShow help.

Examples

Sort files by extension (default)

autosort /path/to/folder

Sort files by name

autosort /path/to/folder --name

Sort files by creation date recursively

autosort /path/to/folder --date --sub

Test sorting (dry run)

autosort /path/to/folder --extension --dry

Watch folder for changes and sort automatically

autosort /path/to/folder --active

Generate a log file

autosort /path/to/folder --log

Logging

If the --log option is used, AutoSort generates a log file in the folder being sorted. The file is named based on the current timestamp. For dry runs, the log file includes [TEST] entries.

Example log file:

Test Run Log - 2025-01-04 15:00:00

[TEST] Would move: /path/to/folder/file1.txt → /path/to/folder/TXT/file1.txt
[TEST] Would move: /path/to/folder/file2.jpg → /path/to/folder/JPG/file2.jpg

Developer Guide

Setting Up the Project

Clone the repository:

git clone https://github.com/smirki/autosort.git
cd autosort

Install dependencies:

npm install

Testing the Script Locally

Link the script to npm for testing:

npm link

You can now use the autosort command globally:

autosort /path/to/folder --name

File Structure

autosort/
├── autosort.js          # Main script file
├── package.json         # Project configuration
├── README.md            # Documentation
├── .gitignore           # Ignored files
├── node_modules/        # Installed dependencies

Contributing

We welcome contributions! To contribute:

  1. Fork the repository.
  2. Create a new branch for your feature/fix.
  3. Commit your changes.
  4. Submit a pull request.

License

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


Contact

For support or inquiries, feel free to contact:

Manav Majumdar
GitHub: smirki


autosortfile-sorterfile-organizerfile-automationsort-filesorganize-filescli-toolcommand-line-toolfile-managementfile-utilitiessort-by-extensionsort-by-namesort-by-datefolder-sorterfolder-organizerrecursive-sortingactive-sortingreal-time-sortingfile-arrangementautomation-toolfile-cleanerfolder-automationfile-sorting-clicli-file-organizernode-cli-toolnode-file-sorternode-folder-organizerfile-cleanupfile-arrangerdirectory-organizerdirectory-sorterfile-organizing-toolfolder-managementfolder-utilitiesreal-time-file-sortingreal-time-folder-sortingdry-rundry-run-file-sortlog-file-managementfile-loggingfile-structurefile-classificationfile-groupingfile-categorizationfile-automation-toolfolder-arrangerfolder-classificationfolder-categorizationfile-hygieneorganize-by-dateorganize-by-typeorganize-by-namedirectory-managementdirectory-cleanupfolder-cleanupfile-tidyingfolder-tidyingfile-watchfolder-watchwatch-file-changeswatch-folder-changeschokidar-toolfile-sort-clisort-clifile-utility-toolfile-utility-clinodejs-cli-toolfile-system-managementfilesystem-organizerfilesystem-sortingfilesystem-automationcli-file-managercli-folder-managerfile-operationsfile-handlingdirectory-arrangerfile-system-toolautomate-file-sortingautomate-folder-sortingfile-directory-toolsort-directory-clisort-folder-clifile-sort-logfile-sort-dry-runauto-sorterauto-organizerauto-sort-filesfile-system-clifile-monitoring-toolsort-node-clinode-file-clinode-folder-clifile-sorting-toolfolder-sorting-toolautosort-toolautosortsortorganizefilesfoldersfile-sorterfile-organizersort-filesfile-managementfolder-organizerfolder-managementfile-arrangerfolder-arrangerfile-cleanupfolder-cleanupfile-classificationfolder-classificationfile-categorizationfolder-categorizationfile-arrangementfolder-arrangementfile-automationfolder-automationsort-by-extensionsort-by-typesort-by-namesort-by-dateorganize-by-extensionorganize-by-typeorganize-by-nameorganize-by-daterecursive-sortingreal-time-sortingwatch-folderswatch-filesfile-monitoringfolder-monitoringreal-time-file-sortingreal-time-folder-sortingcli-toolcommand-line-toolfile-clifolder-clifile-utilityfolder-utilityfile-sort-clisort-clinode-cli-toolnodejs-cli-toolfile-organizing-clifolder-organizing-clicli-file-sortercli-folder-organizerdry-rundry-run-file-sortfile-logfile-logginglog-file-sortingfile-log-creatorfile-systemfile-system-toolfilesystem-sortingfilesystem-organizerfilesystem-automationauto-sorterauto-organizerauto-file-sorterauto-folder-sorterfile-hygienetidy-filesclean-filesorganize-folderorganize-filefile-tidyingfolder-tidyingclean-foldermove-filesgroup-filesgroup-foldersactive-sortingwatch-folder-clichokidar-toolautomate-file-sortingautomate-folder-sortingdirectory-cleanupdirectory-managementdirectory-organizerdirectory-sorternode-folder-clinode-file-clifile-operationssort-bygroup-byfile-utility-tool
1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago