Tagged articles
2 articles
Page 1 of 1
Sohu Tech Products
Sohu Tech Products
Aug 13, 2025 · Fundamentals

How to Track TypeScript API Usage with AST Analysis and Custom Loaders

This article explains how to replace inefficient global searches for third‑party APIs with a TypeScript‑based solution that parses source files into an AST, traverses import declarations, distinguishes import styles, records call counts and line numbers, and overcomes symbol resolution challenges using the TypeScript compiler API.

ASTTypeScriptcode analysis
0 likes · 14 min read
How to Track TypeScript API Usage with AST Analysis and Custom Loaders
Sohu Tech Products
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.

ASTTypeScriptcode analysis
0 likes · 12 min read
Analyzing TypeScript AST to Track API Usage and Build a Visualized Plugin