Parse Code Using the Typescript Compiler API typescript parser compiler api

This function will take a string containing typescript code and an optional object containing compiler options. The function returns the parsed code as a typescript SourceFile object.

Source Code Click Here To See Demo

Traversing the AST Traversing using forEachChild SourceFile Symbol

The SourceFile symbol give us access to the source's type information.

List Exported Members List All Declarations