Github API examples & templates
Use these vals as a playground to view and fork Github API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.

rlesser
Github_SearchTopRepos
* Returns top repos in the past X days
* @param {string | Date} start - start date
* @param {number} days - number of days to search
* @returns {Promise<import("@octokit/rest").Octokit.SearchReposResponse>} top repos in span
Script
jxnblk
GitHubSyncV2DemoVal
This is a demo val that syncs with the jxnblk/valtown-github-sync-v2 GitHub repo See https://val.town/x/jxnblk/GitHubSync for details
HTTP
g
countGithubLOCUI
GitHub Line Counter π GitHub Line Counter , live on val.town ; Ever wondered how many lines of code are in a GitHub repo without the hassle of cloning it? Say hello to GitHub Line Counter β your friendly, web-based LOC inspector! π What It Does This simple tool fetches the GitHub repository as a ZIP file,
decompresses it on the fly (thanks to fflate π¨),
and counts the lines of code β on val.town
with an incredible bandwith and speed. Built with Vanilla JS on the frontend and
powered by val.town on the backend,
itβs lightweight, fast, and ready to use! How to Use Just paste the repo URL, hit "Count Lines," and watch the magic happen! β¨
HTTP

pomdtr
serveGithubRepo
Serve Github Repo Example Click here to preview a commit from 8 years ago. import { serveGithubRepo } from "https://esm.town/v/pomdtr/serveGithubRepo";
export default serveGithubRepo({
owner: "mkdocs",
repo: "mkdocs",
ref: "51ec734"
}); Fork this val to get your own copy, and customize the params. The first load can be a bit slow, but subsequents requests will be cached (both in your browser and on val.town) Use it from the cli deno run --allow-net https://esm.town/v/pomdtr/serveGithubRepoCli mkdocs/mkdocs --ref 51ec734
Script