Skip to content
SPECIFICTION
Get listed

ast-grep vs jscodeshift

ast-grep

ast-grep.github.io

jscodeshift

jscodeshift.com

Side by side

Figureast-grepjscodeshift
Price fromFree—
Free planYes—
Free trial——
Open source——
WebYes—
WindowsYesYes
macOSYesYes
LinuxYesYes
APIYes—
Self-hosted—Yes
Plans published10
Spec score · Code Refactoring Tools9.1 (#1)7.7 (#13)
DistributionThe CLI is distributed through npm, Cargo, Homebrew, MacPorts, Nix, and pip, and can also be built from source.The documentation directs users to install jscodeshift from npm with `npm install -g jscodeshift`.
Purposeast-grep is a fast, polyglot tool for structural code search, linting, and rewriting at scale.jscodeshift is a toolkit for building and running codemods over multiple JavaScript or TypeScript files.

Plans

ast-grep

  • ast-grepFree

ast-grep pricing →

jscodeshift

No plans published.

jscodeshift pricing →

In their own words

ast-grep

ast-grep is a free, open-source tool for structural code search, linting, and rewriting. It matches patterns against syntax-tree nodes, helping developers locate and change code across a codebase rather than searching plain text. Its CLI can preview and apply rewrites interactively, and scan configurable YAML rules with error, warning, info, or hint severity. Rules can combine pattern, kind, regex, relational, and composite conditions, and CLI commands help create and snapshot-test them. The project says it supports more than 20 languages and can load custom languages. JavaScript and WebAssembly APIs allow programmatic syntax-tree work; a browser playground offers a way to try patterns without local installation. Editor options include a VS Code extension and language-server setups, including for Vim and Neovim. The tool is free, has a web interface, and is distributed through package managers or built from source. Its FAQ notes that some advanced static-analysis information is unsupported, and one rule cannot target multiple languages at once.

Visit ast-grep.github.io

jscodeshift

jscodeshift is a free toolkit for developers who build and run codemods across JavaScript, TypeScript, or Flow projects. A codemod parses source into an abstract syntax tree, changes that tree, and generates source code. The runner applies a transform to each file and reports files that were not transformed. Its command line accepts a local transform, a URL, or paths from standard input. Parser choices include Babel, Babylon, Flow, TypeScript, and TSX, with Babel as the default. Users can set child-process limits, choose extensions, exclude paths with ignore patterns or configuration files, and preview changes in dry-run mode. The API supports traversal, filtering, finding, replacing, inserting, removing, and renaming syntax-tree nodes, with optional formatting during output. jscodeshift wraps recast to help preserve source style. Jest and Jasmine utilities support fixture or inline tests, and VS Code debugging guidance is documented. It runs on Linux, macOS, Windows, or self-hosted environments under an MIT license.

Visit jscodeshift.com