Sohu Tech Products
Jul 19, 2023 · Backend Development
Analyzing TypeScript AST to Track API Usage and Build a Visualized Plugin
This article explains how to convert TypeScript source code into an AST, traverse it to collect import statements, distinguish various import forms, and use the TypeScript compiler API to locate identifier symbols, enabling accurate counting of API calls and line numbers for a given dependency.
ASTCompiler APIImport Tracking
0 likes · 12 min read