JavaScript CST Implementation

JSON →
library 0.4.10 ·javascript maintenance
verified May 27, 2026

The `cst` package provides a Concrete Syntax Tree (CST) implementation for JavaScript, distinguishing itself from Abstract Syntax Trees (ASTs) by preserving all source code information, including whitespace, comments, and punctuation. This makes it particularly useful for applications requiring precise code transformation, refactoring, linting, and style enforcement, where original formatting must be maintained. The library aims for 100% compatibility with the ESTree AST specification, ensuring that its `Node` structures align with standard AST representations. A core principle is that the tree always remains valid, protecting against structural inconsistencies during modifications. The current stable version is 0.4.10, but its last publish date was over six years ago, indicating that it is in a maintenance state with no active development or new releases. Despite this, its core functionality for detailed source code representation and manipulation remains sound. Key differentiators include its complete representation of the source text, ESTree AST compatibility, and robust mutation methods designed to preserve code integrity and formatting.

total hits 22
actors 6 distinct systems
last hit 3d ago ByteDance
ByteDance
12
MetaBot
4
GPTBot
2
Script
1
Search engines
1

top countries 🇸🇬 Singapore · 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany