1.3.0 • Published 1 year ago

ts-ast-export v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ts-ast-export

Exports the AST of all TypeScript declaration files of a NPM package to JSON.

Usage

Run

npx ts-ast-export <PACKAGE_NAME> -v <PACKAGE_VERSION>

from the command line. <PACKAGE_VERSION> is optional. As a result, a JSON file with the AST of all *.d.ts files of the package is written to the current folder. By adding the -k options, the downloaded package source will not be deleted after the JSON was generated.

If some syntax is not supported, a warning is printed out to the console. Report an issue at GitHub or create a pull request, if you require the unsopported syntax.

The JSON file looks like this:

{
    "name": "<PACKAGE_NAME>",
    "version": "<PACKAGE_VERSION>",
    "sourceFiles": [{
        {
            "kind": "SourceFile",
            "baseName": "<NAME_OF_SOURCE_FILE>",
            "statements": [
                // statements of the source file
            ]
        }
    }]
}

Status

Currently, it successfully creates a JSON file for the babylonjs/core@7.14.0 package.

1.3.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago