UNPKG

@jsdocs-io/extractor

Version:

Analyze and extract the API from npm packages

14 lines (12 loc) 362 B
import * as tsm from 'ts-morph'; export function getOverview({ indexFile, }: { indexFile: tsm.SourceFile; }): string | undefined { return indexFile .getDescendantsOfKind(tsm.SyntaxKind.JSDocTag) .find((tag) => tag.getTagName() === 'packageDocumentation') ?.getParentIfKind(tsm.SyntaxKind.JSDocComment) ?.getText(); }