awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
benjamn avatar

benjamn/recast

0
View on GitHub↗

Recast

Recast is a JavaScript AST parser and printer designed for automated code refactoring. It converts source code into abstract syntax trees that can be modified and then printed back into source code.

The project focuses on formatting-preserving transformations, storing original whitespace and indentation metadata within syntax tree nodes to reconstruct code without losing its original layout. It also generates character-level source maps to maintain precise correspondences between original input and transformed output.

The toolkit includes utilities for syntax tree manipulation using a visitor pattern, as well as options for generic style pretty-printing. A command-line interface is provided to execute these transformation functions on target files and write the results to disk.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Features

  • Automated Code Refactoring - Automates structural changes to JavaScript source code through programmatic AST manipulation to update patterns across codebases.
  • AST Structure Modification - Provides utilities for replacing, inserting, and removing nodes within the abstract syntax tree structure.
  • AST-Based Source Transformations - Provides structural modifications of source code by replacing matched syntax tree nodes while preserving original formatting.
  • JavaScript AST Transformations - Performs structural modifications of JavaScript source code represented as an abstract syntax tree.
  • Formatting-Preserving Transformers - Modifies JavaScript syntax trees while preserving original whitespace and indentation in the resulting output.
  • Code Refactoring Tools - Automates JavaScript code refactoring by manipulating AST nodes and regenerating source files.
  • Format-Preserving Printing - Retains original whitespace and formatting tokens within the AST to reconstruct source code without losing layout.
  • JavaScript AST Printers - Provides a complete system for parsing JavaScript into ASTs and printing them back to source code.
  • Source Code Generators - Programmatically generates valid JavaScript source code from modified abstract syntax tree representations.
  • Abstract Syntax Tree Parsing - Converts JavaScript source code into a structured tree representation while retaining formatting metadata.
  • Tree Traversal - Utilizes a visitor pattern to programmatically navigate and apply transformations to nodes within the syntax tree.
  • Non-Destructive Source Printing - Splices original source text fragments around modified syntax tree nodes to maintain existing indentation during printing.
  • Syntax Tree Transformers - Provides tools for modifying and rewriting syntax trees to perform complex code transformations.
  • Source Map Generation - Implements character-level source maps to maintain precise correspondences between original input and transformed output.
  • Pretty Printing Algorithms - Offers a generic style pretty-printer that applies consistent global indentation rules regardless of original formatting.
  • JavaScript Source Maps - Generates precise character-level source maps specifically for transformed JavaScript files.
  • Source Map Generation - Creates character-by-character mappings between original source files and generated output for debugging.
  • Source Map Generators - Provides character-level source maps that link transformed output back to the original JavaScript source files.
  • AST & Language Tools - JavaScript AST transformer with source map support.
  • Development Utilities - Syntax tree transformer and source map generator.
5,246 stars·358 forks·TypeScript·MIT·25 views

Star history

Star history chart for benjamn/recastStar history chart for benjamn/recast

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

Frequently asked questions

What does benjamn/recast do?

Recast is a JavaScript AST parser and printer designed for automated code refactoring. It converts source code into abstract syntax trees that can be modified and then printed back into source code.

What are the main features of benjamn/recast?

The main features of benjamn/recast are: Automated Code Refactoring, AST Structure Modification, AST-Based Source Transformations, JavaScript AST Transformations, Formatting-Preserving Transformers, Code Refactoring Tools, Format-Preserving Printing, JavaScript AST Printers.

Which projects share features with benjamn/recast?

Projects with overlapping indexed features include: facebook/jscodeshift — jscodeshift is a JavaScript AST transformation toolkit and codemod engine designed for large-scale code refactoring… dsherret/ts-morph — ts-morph is a TypeScript AST manipulation library and a high-level wrapper for the TypeScript compiler API. It… openrewrite/rewrite — OpenRewrite is an automated refactoring engine and source-to-source migration framework. It uses a lossless semantic… unifiedjs/unified — Unified is a syntax tree processing engine and content ecosystem designed to parse, transform, and serialize text… rubberduck-vba/rubberduck — Rubberduck is a development environment extension designed for legacy Visual Basic and Visual Basic for Applications… benjamn/ast-types — This project is a framework for building, manipulating, and analyzing abstract syntax trees. It provides a toolkit for…

Projects sharing features with Recast

These projects share indexed features with Recast. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • facebook/jscodeshiftfacebook avatar

    facebook/jscodeshift

    9,952View on GitHub↗

    jscodeshift is a JavaScript AST transformation toolkit and codemod engine designed for large-scale code refactoring and structural migrations. It provides a set of utilities to parse source code into abstract syntax trees, programmatically modify those trees, and convert them back into source text. The tool distinguishes itself by preserving original source formatting and stylistic properties during the transformation process. It utilizes a builder for generating structurally valid AST nodes and integrates interchangeable parsing engines to support different language standards and experimenta

    JavaScript
    View on GitHub↗9,952
  • dsherret/ts-morphdsherret avatar

    dsherret/ts-morph

    6,110View on GitHub↗

    ts-morph is a TypeScript AST manipulation library and a high-level wrapper for the TypeScript compiler API. It provides a programmatic interface for analyzing, modifying, and generating TypeScript source code, serving as a tool for automated code refactoring and source code generation. The library simplifies the process of navigating and inspecting project structures by offering an object-oriented abstraction over the underlying compiler API. It allows for the programmatic transformation of existing codebases to automate structural updates and bulk code migrations. Its capabilities cover sta

    TypeScript
    View on GitHub↗6,110
  • openrewrite/rewriteopenrewrite avatar

    openrewrite/rewrite

    3,312View on GitHub↗

    OpenRewrite is an automated refactoring engine and source-to-source migration framework. It uses a lossless semantic tree parser to represent source code as type-aware trees that preserve original whitespace and formatting, enabling precise and deterministic modifications. The project utilizes a declarative refactoring pipeline where sequences of transformations are defined in YAML to resolve breaking changes and technical debt. It features type-aware pattern matching and cross-language model mapping to apply similar refactoring patterns across different programming languages. The framework

    Javaabstract-syntax-treeastcode-search
    View on GitHub↗3,312
  • unifiedjs/unifiedunifiedjs avatar

    unifiedjs/unified

    4,999View on GitHub↗

    Unified is a syntax tree processing engine and content ecosystem designed to parse, transform, and serialize text content. It functions as a plugin-based content pipeline that converts raw text into structured abstract syntax trees using plain JavaScript objects for programmatic inspection and modification. The project distinguishes itself through a modular architecture that enables cross-ecosystem translation, allowing syntax trees to be converted between different specifications such as HTML and Markdown. It utilizes a system of immutable processor cloning and shared state containers, ensur

    JavaScriptastcstjavascript
    View on GitHub↗4,999
Compare all 30 related projects→