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

file-organize

v0.1.2

Published

CLI tool for categorizing files

Downloads

3

Readme

file-organize

A powerful CLI tool for automatically categorizing and organizing files in directories based on their extensions.

License: MIT Node.js: >=16.0.0

Table of Contents

Features

  • 🗃️ Automatically categorize files based on their extensions into organized folders
  • 🔄 Recursively process subdirectories
  • 🚫 Exclude files or directories using regex patterns
  • 📊 Dry run mode tree-based visualization to preview changes before applying them
  • 🪄 Flat mode for organizing all files at the root level
  • 🌲 Tree visualization of the post organized structure
  • ⚙️ (In Progress) Customizable configuration through JSON files

Installation

There are several ways to install file-organize depending on your preference:

1. Binary Installation (Recommended)

Download the pre-built binary for your operating system from the Releases page.

Windows

  • Download the file-organize-win-x64.exe file
  • Rename it to file-organize.exe (optional)
  • Add it to a location in your PATH or run it directly

macOS

# Download the binary
curl -L -o file-organize "https://github.com/himanshuc3/file-organize/releases/latest/download/file-organize-macos-x64"

# Make it executable
chmod +x file-organize

# Move to a directory in your PATH
sudo mv file-organize /usr/local/bin/

Linux

# Download the binary
curl -L -o file-organize "https://github.com/himanshuc3/file-organize/releases/latest/download/file-organize-linux-x64"

# Make it executable
chmod +x file-organize

# Move to a directory in your PATH
sudo mv file-organize /usr/local/bin/

2. NPM Package Installation

Install globally to use as a command-line tool from anywhere:

# Using npm
npm install -g file-organize

# Or using yarn
yarn global add file-organize

# Or using pnpm
pnpm add -g file-organize

3. Build from Source

If you want the latest features or need to customize the build:

# Clone the repository
git clone https://github.com/yourusername/file-organize.git
cd file-organize

# Install dependencies
npm install

# Build the project
npm run build

# Create binaries (optional)
npm run pkg

# The binaries will be available in the 'dist' directory

Usage

file-organize [options]

Options

| Option | Alias | Description | Type | Default | | ------ | ------------- | ----------------------------------------------------------------------------------------------------------------- | ------- | ----------------------- | | -d | --directory | Directory to organize | string | Current directory (.) | | -r | --recursive | Recursively organize each subdirectory | boolean | false | | -e | --exclude | Exclude files and directories using regex | string | none | | -c | --config | Path to config file for mapping folders to extensions (not being consumed currently) | string | none | | -f | --flat | Flat map all files to root directory (Use with recursive flag to convert a tree structure to flat directory tree) | boolean | false | | -o | --dryRun | Output the final file tree before organizing (no changes made) | boolean | false | | -h | --help | Show help | | |

Examples

Basic usage to organize a directory:

# To organize current files in current directory without recursive iteration
file-organize

# To organize files in a specfic directory relative to the cwd
file-organize -d path/to/directory

Recursively organize a directory and all subdirectories:

file-organize -d path/to/directory -r

Perform a dry run to preview changes without making them:

file-organize -o

Exclude files or directories matching a pattern:

file-organize -e "node_modules|\.git"

Default Configuration

The directories will categorize files according to the default configuration following the format given below. The option for customization will be supported soon via JSON files that can be saved and cached in system settings:

{
	"default": [
		{
			"name": "audio",
			"extensions": ["mp3", "wav", "aac", "wma"]
		},
		{
			"name": "video",
			"extensions": ["mp4", "mov", "avi", "mkv", "flv", "wmv"]
		},
		{
			"name": "documents",
			"extensions": [
				"zip",
				"doc",
				"docx",
				"ppt",
				"xls",
				"html",
				"txt",
				"pdf"
			]
		},
		{
			"name": "executables",
			"extensions": [
				"exe",
				"msi",
				"dmg",
				"pkg",
				"deb",
				"rpm",
				"app",
				"appx",
				"appxbundle",
				"appxupload"
			]
		},
		{
			"name": "images",
			"extensions": [
				"jpg",
				"jpeg",
				"png",
				"svg",
				"gif",
				"ico",
				"webp",
				"heic",
				"heif"
			]
		}
	],
	"prefix": "categorize",
	"extra": {
		"name": "miscellaneous"
	}
}
  • prefix: The prefix to be added to category folder names
  • default: Array of category objects, each with a name and array of extensions
  • extra: Configuration for uncategorized files

Getting Started with Development

Prerequisites

  • Node.js 16.0.0 or higher
  • npm, yarn, or pnpm (pnpm is recommended)

Setup

  1. Clone the repository:
git clone https://github.com/yourusername/file-organize.git
cd file-organize
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Running Tests

To run the test suite:

npm run test

Contributing

Contributions are welcome! There's a list of features/enhancements for the next version of the tool present in Requirements.md that are up for grabs. Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please make sure your code follows the existing style and passes all tests.

Releasing

To create a new release with automated binary builds:

  1. Make sure all your changes are committed and merged to the main branch
  2. Create and push a new tag with a version number:
    git tag v1.0.0
    git push origin v1.0.0
  3. The GitHub Actions workflow will automatically:
    • Build the project
    • Create binaries for Windows, macOS, and Linux
    • Publish a new GitHub Release with the binaries
    • Publish the package to NPM

Note: You need to have the NPM_TOKEN secret configured in your GitHub repository settings for the NPM publishing step to work.

License

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