1.0.14 • Published 3 years ago

@appthreat/astgen v1.0.14

Weekly downloads
9
License
Apache-2.0
Repository
github
Last release
3 years ago

AST generator

This script creates Abstract Syntax Tree (AST) of all the files for supported languages in JSON format. AST is created by using the bundled babel parser (for JavaScript, TypeScript) or by invoking appropriate external tools (See table below).

Supported languages

LanguageTool used
Bashshfmt (cli)
JavaScriptbabel
TypeScriptbabel
JSXbabel
TSXbabel
Dockerfiledockerfile-ast

Usage

Installing

sudo npm install -g @appthreat/astgen

Getting Help

bin/astgen -h
Options:
  -v, --version  Print version number                                  [boolean]
  -i, --src      Source directory                                 [default: "."]
  -o, --output   Output directory for generated AST json files
                                                            [default: "ast_out"]
  -t, --type     Project type. Default auto-detect
  -r, --recurse  Recurse mode suitable for mono-repos  [boolean] [default: true]
  -h             Show help                                             [boolean]

Example

Navigate to the project and run astgen command.

cd <path to project>
astgen

To specify the project type and the path to the project.

astgen -t nodejs -i <path to project>

Troubleshooting

shfmt is bundled with astgen and should work for linux amd64. When using astgen on any other platform and architecture, please download and place the cli in the PATH.

1.0.11

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago