DEV Community

Cover image for Tired of Codebases with Mismatched File Casing? 🛠️ Meet CaselyJS (v1.0.1)
Vikash Kumar
Vikash Kumar

Posted on

Tired of Codebases with Mismatched File Casing? 🛠️ Meet CaselyJS (v1.0.1)

Every developer has been there. You join a new project, or you're cleaning up a legacy codebase, and you see it:

  • UserService.ts

  • product_api.js

  • get-orders.ts

  • Final_component.jsx

It’s a visual mess, and it makes finding files in your editor a constant friction point. Manually renaming dozens or hundreds of files is a tedious, error-prone nightmare.

I built CaselyJS to solve this problem permanently, and I just upgraded it to v1.0 with a full TypeScript rewrite and a brand-new CLI.

⚡ The 10-Second Quick Start (No Install Required)

The best way to try CaselyJS is with npx. You can clean up your current project right now without adding a single dependency to your package.json.

# Preview changes (dry run) in the current directory
npx caselyjs --dry

# Re-case all files in the ./src folder to kebab-case
npx caselyjs ./src --case kebab
Enter fullscreen mode Exit fullscreen mode

✨ What’s New in v1.0?

I’ve transformed CaselyJS from a simple string utility into a robust, high-performance CLI tool designed for large-scale codebase refactoring.

Features

  • Full CLI: No code required. Run it directly from the terminal.
    Refactor codebases in seconds.

  • Dry Run Mode: See exactly which files will be renamed before it happens.
    Total peace of mind. Zero risk.

  • Recursive Bottom-Up: Renames deep directories first, keeping parent paths valid.
    It just works, even on deeply nested structures.

  • File Filtering: target specific extensions (e.g., just .ts and .tsx).
    Complete control over the scope of changes.

🚀 Usage Examples

npx caselyjs ./src --full --case pascal --dry
Enter fullscreen mode Exit fullscreen mode

CLI Options

--case: pascal | kebab | camel ( default: kebab, shorthand: -c )

npx caselyjs ./src/components --case pascal

# or
npm caselyjs ./src/components -c pascal
Enter fullscreen mode Exit fullscreen mode

--ext: ( default: "js,jsx,ts,tsx", shorthand: -e )

npx caselyjs ./src/components --ext "go,py,cpp"

# or
npm caselyjs ./src/components -e "go,py,cpp"
Enter fullscreen mode Exit fullscreen mode

--ext overrides the existing extensions

--full: ( default: false, shorthand: -e )

npx caselyjs ./src/components --case kebab --full

# or
npm caselyjs ./src/components -c kebab -f
Enter fullscreen mode Exit fullscreen mode

--dry: ( default: false )

npx caselyjs ./src/components --case kebab --full --dry
Enter fullscreen mode Exit fullscreen mode

🧠 Under the Hood (For the Geeks)

This v1.0 rewrite was about more than just a CLI. I moved the entire core to TypeScript for strict type safety. We use Commander.js for robust flag parsing, Chalk for those beautiful terminal colors, and a custom Bottom-Up Sorting algorithm for recursive folder renames. This ensures that a child file's path isn't broken when its parent folder is renamed during the process.

Mit-Licensed and Open Source
CaselyJS is 100% open source and free to use.

I would love your feedback on the new CLI and features! If you run into any issues or have a feature request (more case types?), please open an issue or pull request on GitHub.

Try it out: npx caselyjs ./your-test-folder --dry

Repository: github.com/codezaura/caselyjs
NPM: npm/caselyjs

Made with ❤️ by codezaura

Top comments (1)

Collapse
 
codezaura profile image
Vikash Kumar

🚀💥Fastest way to organize your codebase

npx casely --case kebab --full
Enter fullscreen mode Exit fullscreen mode

for safety use --dry flag before executing.😃