Skip to content

AST and code generation using current TypeScript version #14906

Answered by bartlomieju
mfulton26 asked this question in Q&A
Discussion options

You must be logged in to vote

How can I use the TypeScript source parser/compiler that is part of my installed deno version to parse a module, look for certain content, and then use that content to generate other source files?

The short answer is no - Deno doesn't expose TSC internals to users for programmatic access.

I did some investigating and it looks like dnt uses https://github.com/dsherret/ts-morph which appears to somehow compile/bundle its own version of the TypeScript compiler (here). I'd prefer to not need to grab typescript myself but use what's already available in deno but maybe I need to bring my own and figure out how to do that.

Using ts-morph or pulling typescript from a CDN is a preferred soluti…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mfulton26
Comment options

Answer selected by mfulton26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants