Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/?q=function&page=1652&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 18162 results for "function"(3321ms)

untitled_sapphireEchidnamain.tsx1 match

@seamusmuf123•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

crates_iomain.tsx1 match

@vladimyr•Updated 1 year ago
26});
27
28export async function getCrateInfo(crateName: string, version?: string) {
29 const createURL = joinURL(API_URL, `/crates/${crateName}`);
30 const crateInfo = parse(CrateInfoSchema, await ky.get(createURL).json());

systemsDevModulemain.tsx1 match

@ethtang•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

npmRegistrymain.tsx1 match

@vladimyr•Updated 1 year ago
17});
18
19export async function getPkgInfo(pkgName: string, version = "latest") {
20 const pkgURL = new URL(encodeURIComponent(pkgName).replace(/^%40/, "@"), REGISTRY_URL);
21 const headers = {

podcastBadgemain.tsx1 match

@vladimyr•Updated 1 year ago
58export default app.fetch;
59
60async function getBadgeOptions(rssUrl: string | URL): Promise<BadgenOptions> {
61 const label = BADGE_LABEL;
62 try {

spotifyPodcastmain.tsx2 matches

@vladimyr•Updated 1 year ago
1export function isSpotifyPodcast(podcastURL: URL | string) {
2 try {
3 podcastURL = new URL(podcastURL);
9}
10
11export function getSpotifyId(podcastURL: URL | string) {
12 try {
13 podcastURL = new URL(podcastURL);

applePodcastmain.tsx2 matches

@vladimyr•Updated 1 year ago
1export function isApplePodcast(podcastURL: URL | string) {
2 try {
3 podcastURL = new URL(podcastURL);
9}
10
11export function getItunesId(podcastURL: URL | string) {
12 try {
13 podcastURL = new URL(podcastURL);

podnewsmain.tsx2 matches

@vladimyr•Updated 1 year ago
6const isString = (arg): arg is string => typeof arg === "string";
7
8export async function getPodnewsId(podcastId: string) {
9 // https://podnews.net/podcast/subscribe-pages
10 const redirectURL = new URL(`/podcast/${podcastId}`, BASE_URL);
24type PodcastInfo = { podcastId: string } | { podnewsId: string };
25
26export async function getFeedUrl(podcastInfo: PodcastInfo) {
27 let podnewsId;
28 if ("podnewsId" in podcastInfo) {

podcastmain.tsx2 matches

@vladimyr•Updated 1 year ago
1import { parseFeed } from "https://deno.land/x/rss@1.0.0/mod.ts";
2
3export async function getLastEpisode(xml: string) {
4 const { entries } = await parseFeed(xml);
5 return entries
8}
9
10export async function getLastPubDate(xml: string) {
11 const lastEpisode = await getLastEpisode(xml);
12 return lastEpisode.published;

handleGroupmeMessagemain.tsx1 match

@tjnoe•Updated 1 year ago
2import process from "node:process";
3
4export async function handleGroupmeMessage(
5 req: express.Request,
6 res: express.Response,

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",