Utility functions for working with TypeScript's API, providing comprehensive tools for analyzing and manipulating TypeScript AST nodes, types, and compiler APIs.
79
Build a utility that counts and categorizes tokens in TypeScript source code.
@generates
/**
* Counts the total number of tokens in TypeScript source code
* @param sourceCode - TypeScript source code as a string
* @returns The total count of tokens
*/
export function countTokens(sourceCode: string): number;
/**
* Extracts all identifier token texts from TypeScript source code
* @param sourceCode - TypeScript source code as a string
* @returns Array of identifier strings found in the source
*/
export function extractIdentifiers(sourceCode: string): string[];Provides TypeScript AST token traversal utilities for iterating over tokens in source code.
@satisfied-by
TypeScript compiler API for parsing source code and working with AST nodes.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-ts-api-utilsevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10