MCPcopy
hub / github.com/cursor/community-plugins / fetchGitHubFile

Function fetchGitHubFile

apps/cursor/src/lib/github-plugin/parse.ts:190–203  ·  view source on GitHub ↗
(
  owner: string,
  repo: string,
  path: string,
)

Source from the content-addressed store, hash-verified

188export type FetchOptions = { maxWaitMs?: number };
189
190async function fetchGitHubFile(
191 owner: string,
192 repo: string,
193 path: string,
194): Promise<string | null> {
195 const url = `https://raw.githubusercontent.com/${owner}/${repo}/HEAD/${path}`;
196 try {
197 const res = await fetch(url, { cache: "no-store" });
198 if (!res.ok) return null;
199 return res.text();
200 } catch {
201 return null;
202 }
203}
204
205async function fetchGitHubTree(
206 owner: string,

Callers 1

parseGitHubPluginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected