npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

autosort

v1.0.2

Published

A modern CLI tool to organize files in a directory.

Maintainers

smirkismirki

Keywords

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

Readme

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

| Option | Alias | Description | |----------------|-------|---------------------------------------------------------| | --name | -n | Sort files by their first letter. | | --extension | -e | Sort files by their file type (extension). | | --date | -d | Sort files by their creation date. | | --sub | -s | Sort files in all subdirectories recursively. | | --active | -a | Watch the folder for changes and sort files automatically. | | --dry | | Simulate sorting without making changes. | | --log | -l | Generate a log file of actions taken. | | --help | -h | Show 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