file-case-converter
CLI tool that renames files and automatically updates all import paths using AST parsing.
Descripción general
A Node.js CLI tool that converts file names across an entire codebase (kebab-case, camelCase, snake_case, PascalCase) and automatically updates all import statements by parsing the source files with an AST — not regex. Supports dry-run mode, ignores node_modules, and works on large projects.
El Problema
Renaming files in a JavaScript/TypeScript project manually breaks imports. Regex-based find-and-replace is fragile and error-prone on large codebases. This tool solves the problem by using AST-based import analysis to safely rename and update everything in one command.
Mi Rol
Designed and built the tool from scratch. Implemented the AST-based import resolver, file renaming logic, case conversion functions, CLI argument parsing, and dry-run preview mode. Published to npm.
Arquitectura
- 1Node.js CLI entry point
- 2Case conversion module (kebab, snake, camel, pascal)
- 3File system traversal (recursive, ignores node_modules)
- 4AST parser for import path extraction and replacement
- 5Dry-run mode to preview changes before applying them
Decisiones técnicas
- Chose AST parsing over regex to make import updates safe and accurate across different import syntax styles.
- Added dry-run mode as a first-class feature — developers should always be able to preview destructive changes.
- Published as an npx-compatible package so users can run it without installing.
Stack tecnológico
Proyectos relacionados
CLI tool for API performance testing that simplifies Grafana k6 workflows.
k6boost is a Node.js CLI tool that wraps Grafana k6 and provides a developer-friendly interface for API performance test...
Full-stack financial dashboard with a Spring Boot backend and Next.js frontend.
Started from a Next.js learning project and extended it into a full-stack application by building a custom Spring Boot R...