Back to APIs list

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.
datascriptExample
tmcw
datascriptExample
datascript example An example using tonsky’s datascript module, which implements a datalog-style database in JavaScript. The module itself is really written in ClojureScript, but they've helpfully produced an npm-compatible module for us to use. Datalog languages are fascinating, and have some real-world use in Roam Research and Logseq.
happyDomExample
tmcw
happyDomExample
happy-dom Happy-dom is a module that provides a DOM-like abstraction that's pretty popular for test frameworks and server-side rendering, because it's a lot faster and lighter than more full-fledged browser-like options. By default, happy-dom doesn't support Deno , which is the basis for Val Town's runtime, but there's a fork that conveniently swaps out the thing it doesn't support, which is the Node.js vm module. Another way to work with the DOM is to use domino .
dominoDomExample
tmcw
dominoDomExample
domino example Domino is an implementation of the document object model that you can use to build "webpages" without requiring a browser or a heavy browser-like abstraction. If you need even less DOM-compatibility and just want to parse some HTML, cheerio is an even more lightweight abstraction that works great.
countries
ingenieroariel
countries
// original comes from https://gist.github.com/graydon/11198540
createIssue
andy_blum
createIssue
Used to post issues back to github from website's UI for non-technical users.
getDuckDB
tmcw
getDuckDB
Get a DuckDB database This method sets up a duckdb-wasm database that you can then use to store and retrieve data.
githubEvents
endingwithali
githubEvents
An interactive, runnable TypeScript val by endingwithali
githubEvents
sdan
githubEvents
An interactive, runnable TypeScript val by sdan
hiNicoFromGists
stevekrouse
hiNicoFromGists
Import from Github Gists You can import from Github Gist's raw URL: await import("https://gist.githubusercontent.com/...") This example pulls from this gist: example.js Which has this code: export const hi = function() { return "Hi Nico!" }
EmailNotifIfDidntCode
Davidkim
EmailNotifIfDidntCode
An interactive, runnable TypeScript val by Davidkim
forwarder
maas
forwarder
Unlimited Anonymous Emails All code can be triggered via email ( docs ), i.e. maas.forwarder@valtown.email . You can generate as many emails as you want to avoid giving away your personal email address and reduce spam. Getting started Log in to Val Town Fork this Val Publish the Val via 🔒 > Unlisted Copy the email endpoint via ⋮ > Endpoints > Copy email address Sign up for newsletters or services using this email ( maas.forwarder@valtown.email ). To remove their ability to email you, simply delete the val (or send it to /dev/null ).
githubFollowers
stungeye
githubFollowers
An interactive, runnable TypeScript val by stungeye
githubNormalizedJsonString
stevekrouse
githubNormalizedJsonString
An interactive, runnable TypeScript val by stevekrouse
githubPayloadStringToNormalizedJSON
vtdocs
githubPayloadStringToNormalizedJSON
An interactive, runnable TypeScript val by vtdocs
githubUser
stevekrouse
githubUser
An interactive, runnable TypeScript val by stevekrouse
renderGithubReadme
pomdtr
renderGithubReadme
An interactive, runnable TypeScript val by pomdtr