Skip to main content

getJsTree

codebolt.codeutils.getJsTree(filePath: string): Promise<GetJsTreeResponse>
Retrieves a JavaScript tree structure for a given file path.

Parameters

NameTypeDescription
filePathstringThe path of the file to retrieve the JS tree for.

Returns:

 Promise<GetJsTreeResponse>
A promise that resolves with the JS tree response.

Examples


const GetJsTree = await codebolt.codeutils.getJsTree();

Explaination

The method codebolt.codeutils.getJsTree(filePath: string) is designed to analyze a JavaScript file located at the given file path and return its tree structure. This tree structure is a hierarchical representation of the code within the file, which typically includes various elements such as functions, variables, classes, etc.