Elestia Open Source Ratings
7.1

Recast

A strong pick. 5th of 9 JavaScript parsers and codemods.

Recast parses JavaScript or TypeScript into an AST and prints it back, reprinting only the nodes you changed so the rest of the file keeps its formatting. jscodeshift and other popular tools build on it. It is still the standard low-level engine for code changes that must keep the source's formatting. Its API is low-level, its printer has long-standing bugs, and it depends on the stale ast-types package.

Best for: Authors of codemod frameworks, CLIs and build plugins who must edit users' source files and keep their formatting and comments.

GitHubnpm

Scores

Overall7.1

How strongly do we recommend it for a new project today?

Claude Opus 5.5: 6.5, likely 5.5 to 7.5

For a tool that must edit source files and keep their formatting, Recast is still the standard engine, and its 2026 revival makes it a safer bet than it was. Most people writing codemods should pick jscodeshift, which wraps it, or ts-morph for type-aware TypeScript changes. Its printer bugs, the stale ast-types dependency and reliance on one maintainer keep it from a higher score.

GPT-6.2 Sol: 7.6, likely 6.5 to 8.7

Recast is a strong starting point for custom JavaScript and TypeScript rewrites where unrelated formatting changes make diffs harder to review. Pick jscodeshift when you need a ready-made batch runner, ast-grep for fast pattern rewrites, or ts-morph when edits depend on TypeScript symbols. Recent printer fixes support adopting Recast today, while Babel 8 adapter friction and a concentrated maintenance team temper the two-year outlook.

Needed by many4.3

How many developers need a tool for this job?

Claude Opus 5.5: 4.0, likely 3.0 to 5.0

Few developers write code that rewrites source code. Those who do are mostly authors of tools, codemods and scaffolding CLIs. Recast's narrower job, format-preserving reprinting, matters most to that group. Many developers run tools built on it without knowing it.

GPT-6.2 Sol: 4.5, likely 3.4 to 5.7

Recast works across frameworks and serves teams writing migrations, upgrade tools, and source editors for JavaScript or TypeScript. Most application teams need to write their own AST transforms only occasionally. The survey measures language use, so the share of developers who need formatting-preserving rewrites remains an estimate.

Helps a lot7.1

How well does it do the job for those who need it?

Claude Opus 5.5: 6.5, likely 5.5 to 7.5

No other JavaScript tool reprints only the changed nodes as well as Recast does. That is why jscodeshift and magicast build on it. It ships types and works with several parsers. The API is low-level, and printing bugs stay open for years: lost BigInt suffixes, extra parentheses, comment placement and Babel cases that lose formatting. A peer such as jscodeshift or ts-morph is easier for most codemod work.

GPT-6.2 Sol: 7.7, likely 6.7 to 8.8

Recast keeps untouched text intact and gives developers and coding agents clear examples for visitors and node builders. Transforms must start with Recast's parse API and preserve original node references. Source review shows that its bundled adapters pass options that Babel 8 rejects, so parser choice matters even for simple input. A 500-file benchmark favored ast-grep for a simple rewrite, while ts-morph provides the symbol references needed for cross-file TypeScript refactors.

Holds up over time6.5

Will it still be a good choice in two years?

Claude Opus 5.5: 6.0, likely 4.5 to 7.5

Maintenance picked up in 2026: 81 commits and releases 0.24.0 to 0.24.3, with many outside pull requests merged and automated releases. One maintainer, eventualbuddha, did most of the merges, and the original author is not active. The stale ast-types dependency and missing oxc support show risk as the ecosystem moves to Rust-based parsers. The tool is so deeply embedded that someone will likely keep it working.

GPT-6.2 Sol: 6.9, likely 5.7 to 8.0

Recast recorded 81 commits in the past year and shipped three GitHub patch releases in November, including fixes for comment and template literal printing. Several contributors supplied fixes, but recent merges cluster around one maintainer and the Oxc adapter remains under review. The 0.24 line also raises the declared minimum to Node.js 22, and long-term staffing and funding are unclear.

Used widely6.7

How many use it, and is that growing?

Claude Opus 5.5: 7.0, likely 6.0 to 8.0

It has about 240M downloads in 4 weeks and about 477k dependent repositories. Most of that comes through jscodeshift, magicast and other tools, not direct choices. Downloads grew 3.7x in a year, below the 4.1 median, so it is slowly losing ground. Direct users are probably in the tens of thousands of projects.

  • npm downloadsLast4Weeks: 240M now vs 64.6M a year ago, a 3.7x ratio below the 4.1 median
  • dependents.repos: 476,621 repositories, more than jscodeshift and ts-morph
  • bluesky.posts: Only 1 post, so little direct attention

GPT-6.2 Sol: 6.3, likely 4.9 to 7.5

Ecosyste.ms finds about 477,000 dependent repositories, above jscodeshift and ts-morph but below Acorn and Babel parser. Four-week installs rose from 64.6 million to 240 million, or 3.72×, below the catalog median of 4.1× and behind ts-morph and ast-grep. Downstream installs through tools such as jscodeshift and sparse public discussion make direct adoption hard to estimate.

  • dependents.repos, dependents.packages, peers: 476,621 indexed repositories and 1,789 indexed npm packages.
  • npm.downloadsLast4Weeks, npm.downloadsSame4WeeksYearAgo, medianDownloadsRatio, peers: 3.72× growth trails the 4.1× median and faster-growing rewrite peers.
  • github.stars, bluesky.posts, hackerNews.stories: 5,257 stars, one Bluesky link post, and no matched Hacker News stories.
  • github.com/facebook/jscodeshift/blob/main/README.md?plain=1: jscodeshift wraps Recast and drives downstream installs.
Vouched for7.2

Who stands behind it being good?

Claude Opus 5.5: 6.5, likely 5.5 to 7.5

Meta's jscodeshift, UnJS magicast and many framework CLIs build on it, and Chromium DevTools vendors it. Houdini maintainers report it works well. It has no survey data and no independent benchmark, and most endorsements come from embedding, not from recent reviews.

GPT-6.2 Sol: 7.8, likely 6.7 to 8.8

Meta's jscodeshift builds on Recast, and both Next.js and monday.com's Vibe use that stack for migrations. Houdini also declares a direct dependency. These integrations show that teams rely on Recast for real tooling, though several use older release lines and there is little direct evidence of broad satisfaction with 0.24.3.

Safe7.4

How safe is it to depend on?

Claude Opus 5.5: 7.5, likely 6.5 to 8.5

It has no advisories ever, 5 dependencies and an MIT licence. Releases now come from GitHub Actions. The OpenSSF Scorecard is 5.5, with weak token permissions, no security policy and only partly pinned dependencies. As a dev-time tool, it usually does not run in production.

  • advisories.total: 0 advisories
  • scorecard.score: 5.5, with Token-Permissions, Security-Policy and SAST at 0
  • npm dependencies: 5 dependencies
  • github.com/benjamn/recast/releases: Releases published by the github-actions bot

GPT-6.2 Sol: 7.3, likely 6.1 to 8.4

Recast has a permissive MIT license, five direct runtime dependencies, and zero advisories in the supplied OSV snapshot. Its GitHub Actions release workflow runs tests before publishing through npm trusted publishing. The 5.5 OpenSSF Scorecard flags weak token permissions, pinning, and branch protection, and gives no credit for a security policy or fuzzing. The current set of people with release authority is unclear.

  • advisories.total, npm.dependencies, npm.license: Zero recorded advisories, five direct dependencies, and MIT licensing.
  • scorecard.score, scorecard.checks: Code review scores 8, token permissions scores 0, and pinning and branch protection each score 3.
  • github.com/benjamn/recast/blob/v0.24.3/.github/workflows/release-please.yml: Tests run before the OIDC-enabled npm publish step.

Good

  • It keeps the original formatting and comments of unchanged code, so diffs stay minimal and easy to review.
  • You can plug in Babel, TypeScript, Acorn, Esprima or Flow parsers, and it generates source maps automatically.
  • It is proven at scale: jscodeshift, magicast and many CLIs run on it, and ecosyste.ms counts about 477k dependent repositories.
  • It is small and low-risk to install: 5 dependencies, an MIT licence and no known advisories.

Bad

  • The API is low-level. It has no collection API, no CLI runner and no type-aware analysis; jscodeshift and ts-morph add those.
  • The printer has long-standing bugs that stay open for years, around comments, parentheses, JSX and newlines.
  • It depends on ast-types, which is stale, and it does not support oxc-parser.
  • It is still at version 0.x, and in 2026 one maintainer did most of the work.

The numbers

npm downloads, 4 weeks
240M ×3.7 in a year
GitHub stars
5.3k
Commits, 12 months
81
npm version
0.24.3 Nov 2026
Versions, 12 months
14
Advisories, 24 months
0 of 0 ever
OpenSSF Scorecard
5.5 out of 10, Nov 2026
Licence
MIT

Read on 21 November 2026 from GitHub (benjamn/recast), npm (recast), OSV and the OpenSSF Scorecard.

JavaScript parsers and codemods

  1. 8.0Babel parser
  2. 7.8Oxc parser
  3. 7.5ast-grep
  4. 7.1Acorn
  5. 7.1Recast
  6. 7.0ts-morph
  7. 6.4jscodeshift
  8. 6.3Meriyah
  9. 2.4Esprima
Compare all 9 on six scores