file-case-converter
v1.4.5
Published
CLI tool to rename files to kebab, snake, camel, or Pascal case and automatically update import paths
Downloads
107
Maintainers
Readme
🚀 file-case-converter
Rename files across your entire project and automatically fix all imports — in one command.
⚡ Convert to kebab-case, camelCase, snake_case, or PascalCase
🧠 AST-powered import updates (no broken code)
📁 Works on large codebases instantly
✨ Why this tool?
Messy file names like:
MyComponent.jsxuserProfile.tsHELLO_WORLD.js
👉 make your project inconsistent and hard to maintain.
file-case-converter fixes everything automatically:
✔ Converts file names to your preferred case
✔ Updates import paths safely (AST-based)
✔ Works on entire projects
🧠 Smart Import Updates (What makes this different)
Unlike other tools, file-case-converter:
- Parses your code using AST
- Updates all import paths automatically
- Avoids breaking your project
❌ No fragile regex
❌ No manual fixes
✅ Just works
⚡ Features
🔄 Rename files recursively
🧠 Supports multiple cases:
- kebab-case
- snake_case
- camelCase
- PascalCase
🔒 Safe import updates (no regex hacks)
⚡ Fast and easy to use
🧪 Dry-run mode (preview changes)
🚫 Ignores
node_modulesautomatically
📦 Installation
Use instantly (no install)
npx file-case-converter .Install globally
npm install -g file-case-converterfile-case-converter .🚀 Usage
# Default (kebab-case)
file-case-converter .
# snake_case
file-case-converter . --case snake
# camelCase
file-case-converter . --case camel
# PascalCase
file-case-converter . --case pascal🔍 Dry Run (recommended)
Preview changes before applying:
file-case-converter . --dry-run🔄 Real Project Example
Before:
src/
MyComponent.jsx
userProfile.tsAfter:
src/
my-component.jsx
user-profile.ts✔ All imports updated automatically
✔ No broken references
🛡️ Safe Usage
# backup first
git add .
git commit -m "before rename"- Dry-run mode to preview changes
- AST-based updates (no broken imports)
- Works well with Git (easy rollback)
👉 You’re always in control
🎯 Use Cases
- Clean up messy projects
- Enforce naming conventions
- Refactor legacy codebases
- Improve code consistency
❤️ Why developers love it
- Simple CLI
- No config needed
- Works instantly
- Saves hours of manual work
📄 License
MIT
🔗 Repository
github.com/sabeerwaqas/file-case-converter
🔎 Keywords
rename files, file rename cli, file case converter, kebab case, snake case, camel case, pascal case, rename imports, javascript cli, nodejs tool, code refactor, file rename tool, batch rename files, case converter, javascript file renamer, cli file rename"
