Back to Explore

davidbonnet/astring

GitHub
1 watchersOpen source

Last release:

Astring is a tiny, fast JavaScript code generator that turns an ESTree-compliant AST into JavaScript source code. It’s useful for projects that need to generate code (optionally with source maps and comments) from ASTs produced by parsers like Acorn or Meriyah.

Project status

  • Maintenance status: The most recent upstream activity was 2024-12-01, and the newest recorded GitHub update is v1.9.0 on 2024-08-25, so relative to 2026-06-09 the project appears quiet and likely in maintenance mode rather than actively maintained.
  • Update cadence: Updates are sporadic (notably 2024, then 2023, then 2021, with long gaps), suggesting low ongoing cadence.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v1.9.0

    No release notes were provided by the publisher for v1.9.0. The code changes for this version primarily add support for the import attributes syntax (`with { ... }`) in Astring’s code generation, along with updated parsing/generation tests and fixtures.

  • v1.8.6

    v1.8.6 makes a generator precedence fix related to nullish coalescing (??) when combined with boolean/logical operators (||, &&). The release notes section provided for this version contains no published changes, so the behavioral impact comes entirely from the code diff.

  • v1.8.5

    This release (v1.8.5) makes a targeted fix to how the generator handles operator precedence, specifically around the nullish coalescing operator (??). It also updates package metadata to expose TypeScript types via the conditional exports map. No release notes were provided in the release_notes section, but the repository changelog indicates a precedence bug fix and a packaging/types change.

  • v1.8.4

    v1.8.4 appears to be a small bug fix release focused on correct code generation for class fields, especially static computed properties and class fields without initializers. The repository also includes related TypeScript definition adjustments and some repo/build tooling updates.

  • v1.8.0

    v1.8.0 extends the astring code generator to support additional ES class syntax, including private identifiers and static blocks, and updates the project’s documented maximum generated ECMA version to 13 (2022). The codebase also undergoes significant dev tooling and dependency updates. No GitHub release notes were provided for this release.

    BreakingFeatures
  • v1.7.6

    No release notes were provided for v1.7.6. The code diff indicates a correctness fix around nullish coalescing operator precedence, plus a change in how tagged template expressions are formatted (not just how they are tested).

  • v1.7.4

    Release v1.7.4 contains no provided GitHub release notes. The code diff primarily changes package publishing and module resolution behavior (package.json fields, build/prepare scripts, and what files are included in npm), rather than core runtime logic.

  • v1.7.2

    Release v1.7.2 updates Astring's code generation logic, primarily around emitting parentheses correctly for several JavaScript syntactic forms. The repository changelog indicates a fix for missing parentheses in class extends, ternary (conditional), and arrow function related cases, and the test fixtures were expanded accordingly.

  • v1.7.1

    No release notes were provided for v1.7.1. The code diff shows a targeted fix for source map generation around the `debugger` statement, along with test/fixture updates and a set of development dependency version bumps.

  • v1.7.0

    No release notes were provided by the publisher for version 1.7.0. From the repository changes, the main additions are TypeScript type definitions, a new package.json "types" entry, and updates to development tooling dependencies, along with removal of a sourcemaps utility source file.

    Features