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 🙏

© 2026 – Pkg Stats / Ryan Hefner

folderly

v0.1.2

Published

A simple file organizer CLI for sorting files into category folders.

Readme

folderly — Simple File Organizer (CLI)

npm version downloads GitHub license PRs Welcome GitHub Repo stars

folderly is a small, dependency-free Node.js CLI that scans a directory (non-recursively) and sorts regular files into category folders based on file extension (documents, images, videos, code, etc.). It is designed to be fast and predictable and publishes as an npm binary folderly.

Features

  • Classifies files by extension into named folders (documents, images, music, videos, code, archives, etc.)
  • Category Filtering: Only organize the file types you care about using flags (e.g., --code --images).
  • Built-in help manual (--help) with dynamically generated valid categories.
  • Strict error handling (safely fails on typos or missing directories).
  • Uses safe filesystem operations (Node's fs/promises and C equivalents)
  • Small, standalone entrypoint available in both Node.js and C.
  • Case-insensitive extension matching.

Installation

Install globally with npm:

npm install -g folderly

Or run directly with npx:

npx folderly

Usage

Run in the directory you want to organize (defaults to current directory):

folderly
# or specify a path
folderly path/to/dir

Filtering by Category

You can organize only specific types of files by passing their category names as flags. Any files that don't match the provided categories will be ignored.

folderly --code --images
# or combine with a target path
folderly path/to/dir --documents

Example Output

folderly test_foldercopy2/test_folder --code
Folderly - Simple File Organizer
Organizing files in: test_foldercopy2/test_folder
Filtering for categories: code

Moved: typescript.ts -> code/

Done! 1 moved, 0 failed

To see the full list of valid category flags, run the built-in manual:

folderly --help

Example Output

folderly — Simple File Organizer (CLI)

Usage:
  folderly [options] [target_directory]

Arguments:
  target_directory    The directory to organize (defaults to current directory ".")

Options:
  --help, -h          Show this help message
  --<category>        Only organize files of this category (e.g., --code, --music)

Valid Categories:
  3d, archives, backups, certificates, code
  configs, data, design, documents, fonts
  images, logs, music, others, presentations
  programs, spreadsheets, videos

Lets Try:

Example Output

Folderly - Simple File Organizer
Organizing files in: test_folder

Moved: photo.jpg -> images/
Moved: sample.txt -> documents/
Moved: audio.wav -> music/
Moved: movie.mp4 -> videos/
Moved: unknown.xyz -> others/

Done! 5 moved, 0 failed

Notes & Behavior

  • Only regular files are moved; subdirectories are left untouched.
  • Files with unknown extensions are moved to the others folder.
  • If an unrecognized flag is passed (e.g. --documana), the program will abort immediately to prevent partial execution.
  • The command uses fs.rename() so moves are fast but can fail across different mount points/filesystems.
  • No recursive scanning (only the specified directory level).

NB: Special handling for .ts files

  • .ts files are ambiguous (video container vs TypeScript source). To avoid misclassification, folderly implements a size-based rule:
    • If a .ts file is larger than 1024 KB (1,048,576 bytes) it will be moved to the videos folder.
    • If a .ts file is smaller than or equal to 1024 KB it will be moved to the code folder.
    • If the program cannot stat the file to determine size it will fall back to the normal extension-based mapping.

This behavior is intentional and documented so users understand why some .ts files may end up in videos instead of code.

Contributing

Contributions are welcome. Preferred workflow:

  1. Fork the repo
  2. Create a feature branch: git checkout -b feature/your-change
  3. Make changes and add tests if appropriate
  4. Commit and push your branch
  5. Open a Pull Request

License

MIT. See the LICENSE file for details.

Links