Inspect Class & Its Methods
Introspect and summarize the instance/static methods and getters of JavaScript/TypeScript classes.
Overview
Powerful utilities for examining and summarizing the instance/static methods and getters of JavaScript/TypeScript classes. Analyze class APIs, count methods/getters, and get comprehensive breakdowns—great for meta-programming, documentation tooling, and runtime validation.
Example Usage
Function Signatures
getInstanceMethodNames
function getInstanceMethodNames(cls: Constructor): string[]Returns alphabetical names of instance methods defined directly on the class prototype (excluding constructor and getters).
getStaticMethodNames
function getStaticMethodNames(cls: Constructor): string[]Returns alphabetical names of static methods defined directly on the class itself.
getInstanceGetterNames
function getInstanceGetterNames(cls: Constructor): string[]Returns alphabetical names of instance getters defined directly on the class prototype.
getStaticGetterNames
function getStaticGetterNames(cls: Constructor): string[]Returns alphabetical names of static getters defined directly on the class itself.
getClassDetails
function getClassDetails(cls: Constructor): ClassDetailsReturns a structured summary object containing method names, getter names, and their respective counts.
Types
ClassDetails
interface ClassDetails {
instanceMethods: string[];
staticMethods: string[];
instanceGetters: string[];
staticGetters: string[];
instanceCount: number;
staticCount: number;
totalGetters: number;
totalMethods: number;
}Last updated: Sun, Jun 14, 2026 07:06:16AM (UTC)
Miscellaneous Utilities
General-purpose utilities for common programming tasks, including JSON parsing, prototyping, debouncing, throttling, country phone lookups, and console styling.
Convert Array to String
Joins elements of a primitive array or extracts and joins nested object fields into a single string.
