MCPcopy Create free account
hub / github.com/TanStack/cli / fetchDocContent

Function fetchDocContent

packages/cli/src/discovery.ts:72–90  ·  view source on GitHub ↗
(
  repo: string,
  branch: string,
  filePath: string,
)

Source from the content-addressed store, hash-verified

70}
71
72export async function fetchDocContent(
73 repo: string,
74 branch: string,
75 filePath: string,
76): Promise<string | null> {
77 const url = `https://raw.githubusercontent.com/${repo}/${branch}/${filePath}`
78 const response = await fetch(url, {
79 headers: { 'User-Agent': 'tanstack-cli' },
80 })
81
82 if (!response.ok) {
83 if (response.status === 404) {
84 return null
85 }
86 throw new Error(`Failed to fetch doc: ${response.statusText}`)
87 }
88
89 return response.text()
90}
91
92export async function searchTanStackDocs({
93 query,

Callers 1

cliFunction · 0.85

Calls 1

textMethod · 0.65

Tested by

no test coverage detected