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

smart-renamer

v1.2.1

Published

πŸš€ Intelligent file naming suggestions based on project-specific naming conventions. Interactive CLI tool that asks yes/no for each file renaming.

Readme

Renamer

πŸš€ Intelligent file naming suggestions based on project-specific naming conventions.

A TypeScript/Bun CLI tool that automatically detects, suggests, and renames files to follow your project's naming patterns. Interactive and smart - it asks you about each file individually!

Features

  • 🎯 Smart Convention Detection: Automatically detects naming patterns from existing files
  • βš™οΈ Flexible Configuration: Store naming preferences in naming.config
  • πŸ”„ Interactive Renaming: Ask yes/no for each file individually
  • πŸ–₯️ CLI Interface: Command-line tool for managing naming conventions
  • βœ… Validation: Ensures new file names follow project conventions
  • 🚫 Smart Exclusions: Automatically skips config files, images, and markdown files
  • πŸ“Š Project Analysis: Analyze naming consistency across your project
  • πŸ‘€ File Watcher: Monitor for new files and suggest names in real-time

Supported Naming Conventions

  • camelCase: fileName.ts
  • snake_case: file_name.ts
  • kebab-case: file-name.ts
  • PascalCase: FileName.ts
  • UPPER_SNAKE_CASE: FILE_NAME.ts

Installation

npm install -g smart-renamer
# or
bun install -g smart-renamer

Quick Start

# Initialize in your project
cd your-project
renamer init

# Rename files interactively - asks yes/no for each file
renamer rename

# Analyze your project's naming patterns
renamer analyze

Commands

renamer init

Initialize naming convention for your project with interactive setup:

renamer init

renamer rename ⭐ Main Command

Interactive file renaming - asks yes/no for each file:

# Interactive mode - asks yes/no for each file
renamer rename

# Preview what would be renamed
renamer rename --dry-run

# Rename all files without asking
renamer rename --force

# Keep specific files unchanged
renamer rename --keep "file1.js,file2.ts"

renamer set-convention <convention>

Set the naming convention:

renamer set-convention kebab-case

renamer validate

Validate existing file names:

# Check all files
renamer validate

# Show suggested fixes
renamer validate --fix

renamer suggest <filename>

Get naming suggestions for a specific file:

renamer suggest "MyFileName.ts"

renamer watch

Monitor for new files and suggest names:

renamer watch

renamer analyze

Analyze project structure and naming patterns:

renamer analyze

Configuration

Create a naming.config file in your project root:

[naming]
convention=kebab-case
files=*.ts,*.js
folders=kebab-case
exceptions=index,main,app

Configuration Options

  • convention: Primary naming convention
  • files: File patterns to apply the convention to
  • folders: Naming convention for directories
  • exceptions: Files that don't need to follow the convention

Smart Exclusions

The tool automatically skips these file types:

🚫 Automatically Excluded:

  • Config files: Any file containing "config" (next.config.mjs, webpack.config.js)
  • Image files: .jpg, .png, .svg, .gif, etc.
  • Markdown files: .md, .markdown
  • Declaration files (all languages):
    • TypeScript: .d.ts, .d.mts, .d.cts (like next-env.d.ts, types.d.ts)
    • C/C++: .h, .hpp, .hxx (header files)
    • Python: .pyi (stub files)
    • Haskell: .hi (interface files)
    • Ruby: .rbi (interface files)
    • ReasonML: .rei (interface files)
    • OCaml: .mli (interface files)
    • F#: .fsi (signature files)
    • And more: .sig, .spec, .def
  • System files: package.json, tsconfig.json, .gitignore, etc.
  • Lock files: package-lock.json, yarn.lock, bun.lockb
  • Environment files: .env, .env.example
  • Build configs: webpack.config.js, vite.config.ts, etc.

πŸ“„ Example Output:

$ renamer rename

πŸ”„ Finding files to rename to 'kebab-case' convention...

πŸ“„ Skipping next.config.mjs (config files excluded by default)
πŸ“„ Skipping logo.png (image files excluded by default)
πŸ“„ Skipping README.md (markdown files excluded by default)
πŸ“„ Skipping next-env.d.ts (TypeScript declaration files excluded by default)
πŸ“„ Skipping utils.h (C/C++ header files excluded by default)
πŸ“„ Skipping types.pyi (declaration files excluded by default)

πŸ“ Found 3 files that can be renamed:

? Rename "userService.ts" to "user-service.ts"? (Y/n) y
βœ… userService.ts β†’ user-service.ts

? Rename "api_helper.js" to "api-helper.js"? (Y/n) y
βœ… api_helper.js β†’ api-helper.js

? Rename "MyComponent.jsx" to "my-component.jsx"? (Y/n) n
⏭️  Skipped MyComponent.jsx

πŸ“Š Completed: 2 renamed, 1 skipped, 0 failed

Usage Examples

Typical Workflow

# 1. Initialize in your project
cd my-react-app
renamer init

# 2. Choose kebab-case for consistency
# (Interactive setup will guide you)

# 3. Rename existing files
renamer rename
# This will ask about each file: "Rename UserProfile.jsx to user-profile.jsx?"

# 4. Set up file watching for new files
renamer watch

Project Analysis

$ renamer analyze

πŸ“Š Project Analysis

πŸ“ Total files: 45
🎯 Most common convention: camelCase
πŸ“ˆ Consistency: 73.3%

πŸ“‹ Convention breakdown:
   camelCase              25 files (55.6%)
   kebab-case             12 files (26.7%)
   snake_case              5 files (11.1%)
   PascalCase              3 files (6.7%)
   UPPER_SNAKE_CASE        0 files (0.0%)

Why Use Renamer?

  • Consistency: Maintain consistent naming across your project
  • Team Standards: Enforce team naming conventions
  • Refactoring: Easily migrate from one naming style to another
  • New Projects: Set up naming standards from the start
  • Code Quality: Improve codebase readability and maintainability

Tech Stack

  • Runtime: Bun
  • Language: TypeScript
  • CLI: Commander.js
  • File Watching: Chokidar
  • Interactive Prompts: Inquirer.js

Contributing

  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

License

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


Made with ❀️ for developers who care about consistent naming conventions.