This is a monorepo with packages to boost the DX of working with AST (using JavaScript programming language) related to:
- DX friendly.
- Cross-runtime friendlyβπ this also means ESM only.
- e18e friendly.
- Extensive tests and benchmarks.
In order to work with AST, the following processes are recognized:
- Parsing stringified code syntax into AST object.
- Traversing the AST object.
- Analyzing the AST object(s).
- Building programmatically the AST node(s), or an entire object.
- Printing the AST object back into stringified code syntax.
Important
The following lists of packages contains what you can combine together - based on shared AST node interface format - aligned with ESTree specification.
Note
Not all of these packages are part of this monorepo.
Getting the AST object from stringified code syntax.
Name | Languages | In this repository? |
---|---|---|
@swc/core |
β | |
svelte/compiler |
β |
In other words, walk on the AST object.
Name | Languages | In this repository? |
---|---|---|
zimmerframe |
β |
Analyze the received AST object(s). Contains type-guards and utilities.
Name | Languages | In this repository? |
---|---|---|
js-ast-analyze |
β | |
ts-ast-analyze |
β | |
svelte-ast-analyze |
β |
Sometimes you need to do some code transformation...
Name | Languages | In this repository? |
---|---|---|
js-ast-build |
β | |
ts-ast-build |
β | |
svelte-ast-build |
β |
Print the AST object or nodes into stringified code syntax.
Name | Languages | In this repository? |
---|---|---|
esrap |
β | |
svelte-ast-print |
β |
If you can offer your time - refer to Contribution Guide.
Otherwise, consider sponsoring me.
Mateusz "xeho91" Kadlubowski