A pluggable JavaScript syntax transformation utility using the Esprima parser for single-pass AST traversal.
JSTransform is a JavaScript syntax transformation tool that enables developers to apply custom syntax transforms to JavaScript code. It uses the Esprima parser to generate an abstract syntax tree (AST) and allows pluggable visitors to modify the code in a single pass, offering fine-grained control over output formatting and source map generation.
Developers and tooling authors who need to write or apply custom JavaScript syntax transformations, particularly those prioritizing single-pass performance and precise output control.
Developers choose JSTransform for its simplicity, single-pass AST traversal for performance, and fine-grained control over code formatting and source map generation, though the project notes that multi-pass pipelines like Babel are better for complex transformation chains.
A simple utility for pluggable JS syntax transforms using the esprima parser.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enables writing custom syntax transforms using a visitor pattern, as shown in the example for modifying eval() calls with precise output control.
Coalesces multiple transformations in one AST traversal, offering performance benefits for simple transform chains compared to multi-pass tools.
Provides per-transformation control over code formatting, allowing custom adjustments like appending alerts before specific function calls.
Supports generating source maps to map transformed code back to the original source, aiding in debugging with options for inline maps.
Includes optional transformations for ES6 features like classes and arrow functions, easing backward compatibility without external plugins.
The project is explicitly marked as not actively maintained, posing risks for long-term viability, security updates, and compatibility with newer JavaScript versions.
Makes writing complex, interdependent transformations difficult, as acknowledged in the README, where multi-pass pipelines like Babel are recommended for such cases.
Compared to tools like Babel, it lacks extensive support for newer JavaScript features and a broad plugin ecosystem, focusing mainly on ES6 and React transforms.
Requires deep understanding of AST manipulation and the visitor pattern to write custom transforms, which can be challenging for developers new to compiler tools.