jscodeshift is a toolkit for running codemods over multiple JavaScript or TypeScript files. It provides a runner that executes transforms across files and outputs a summary of results, along with a wrapper around recast that offers a jQuery-like API for AST manipulation while preserving code style.
The tool solves the problem of applying large-scale code transformations across codebases. Rather than manually editing files, developers write a transform module that exports a function receiving file information, an API object, and options. The runner then applies this transform to each file, collecting statistics about which files were successfully modified. The wrapper around recast abstracts away low-level AST details while maintaining the original code's formatting conventions, making it practical to refactor real-world projects without losing style consistency.
jscodeshift suits teams performing large refactorings, API migrations, or systematic code cleanup across multiple files. It works well for projects using JavaScript or TypeScript and scales to processing entire directories. The tool supports both CLI usage for batch transformations and programmatic usage from JavaScript code. Transform modules can be written in TypeScript, and the runner provides debugging support through VSCode integration. The approach of preserving original code style distinguishes it from simpler AST rewriting tools that might produce reformatted output.
The project maintains active test coverage with a build status indicator on the main branch. Development activity shows ongoing maintenance of the codebase with regular updates to keep the toolkit functional across evolving JavaScript and TypeScript ecosystems. The project provides comprehensive documentation through its website, including detailed API references and examples for developers building custom transforms.