MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / parseHubFile

Function parseHubFile

src/core/hub.ts:57–72  ·  view source on GitHub ↗
(hubPath: string)

Source from the content-addressed store, hash-verified

55}
56
57export async function parseHubFile(hubPath: string): Promise<HubInfo> {
58 const content = await readFile(hubPath, "utf-8");
59 const lines = content.split("\n");
60
61 let title = basename(hubPath, extname(hubPath));
62 const headingMatch = content.match(/^#\s+(.+)$/m);
63 if (headingMatch) title = headingMatch[1].trim();
64
65 return {
66 hubPath,
67 title,
68 links: parseWikiLinks(content),
69 crossLinks: parseCrossLinks(content, hubPath),
70 raw: content,
71 };
72}
73
74export async function discoverHubs(rootDir: string): Promise<string[]> {
75 const hubs: string[] = [];

Callers 3

hub.test.mjsFile · 0.85
getFeatureHubFunction · 0.85
findOrphanedFilesFunction · 0.85

Calls 2

parseWikiLinksFunction · 0.85
parseCrossLinksFunction · 0.85

Tested by

no test coverage detected