Skip to main content
Home
Works with
This package works with Cloudflare Workers, DenoIt is unknown whether this package works with Node.js, Bun, Browsers
This package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score100%
Downloads144/wk
Published2 years ago (0.0.3)

Load fresh content directly from GitHub

function fetchGitHubRepoContent
fetchGitHubRepoContent(
ownerName: string,
repoName: string,
shaOrTag: string,
path: string,
): Promise<Response>

Loads a particular file’s content from a GitHub repo.

Parameters

ownerName: string

The GitHub account (user or org).

repoName: string

The GitHub repo under the owner.

shaOrTag: string

The git SHA or tag. Use fetchGitHubRepoRefs() to retrieve a list of HEAD & branch SHAs.

path: string

The workspace file path to load.

Return Type

A Response with HTTP status and body. Use .text() to grab the text content, or .arrayBuffer() for binary content like images.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@collected/github-fetch

Import symbol

import { fetchGitHubRepoContent } from "@collected/github-fetch";
or

Import directly with a jsr specifier

import { fetchGitHubRepoContent } from "jsr:@collected/github-fetch";

Add Package

pnpm i jsr:@collected/github-fetch
or (using pnpm 10.8 or older)
pnpm dlx jsr add @collected/github-fetch

Import symbol

import { fetchGitHubRepoContent } from "@collected/github-fetch";

Add Package

yarn add jsr:@collected/github-fetch
or (using Yarn 4.8 or older)
yarn dlx jsr add @collected/github-fetch

Import symbol

import { fetchGitHubRepoContent } from "@collected/github-fetch";

Add Package

vlt install jsr:@collected/github-fetch

Import symbol

import { fetchGitHubRepoContent } from "@collected/github-fetch";

Add Package

npx jsr add @collected/github-fetch

Import symbol

import { fetchGitHubRepoContent } from "@collected/github-fetch";

Add Package

bunx jsr add @collected/github-fetch

Import symbol

import { fetchGitHubRepoContent } from "@collected/github-fetch";