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/$%7Bart_info.art.src%7D?q=function&page=2681&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 29123 results for "function"(2616ms)

val_town_by_example_parsemain.tsx2 matches

@pomdtr•Updated 1 year ago
26}
27
28export function extractSnippets(content: string): ExampleSnippet[] {
29 // Separate the code into snippets.
30 const snippets: ExampleSnippet[] = [];
86}
87
88export async function parseExample(author: string, name: string): Promise<Example> {
89 let { code } = await api<{ code: string }>(`/v1/alias/${author}/${name}`);
90 // Substitute $std/ with the full import url

BlueCardChangeDetectormain.tsx1 match

@wilhelm•Updated 1 year ago
6const dateChangedKey = "work-permit-change-date";
7
8export default async function(interval: Interval) {
9 const page = await fetch(site).then(res => res.text());
10 const date = page.match(/Last updated: <time datetime="([^"]+)">/)?.[1].toString();

apimain.tsx1 match

@pomdtr•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2
3export async function api<T = any>(
4 path: string,
5 options?: RequestInit & {

discordEventReceivermain.tsx1 match

@neverstew•Updated 1 year ago
1export default async function handler(req: Request) {
2 console.log(await req.json());
3 return Response.json({ ok: true });

apimain.tsx1 match

@zeroftdev•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2
3export async function api<T = any>(
4 path: string,
5 options?: RequestInit & {

CS1200SystemsDevmain.tsx1 match

@stephencooley123•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",

aquamarineFlamingomain.tsx1 match

@tual•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",

cyanVolemain.tsx1 match

@rohannagpure45•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2// Fetches a random joke.
3async function fetchRandomJoke() {
4 const response = await fetch(
5 "https://official-joke-api.appspot.com/random_joke",

oliveButterflymain.tsx1 match

@yawnxyz•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function openaiUploadFile({ key, data, purpose = "assistants" }: {
4 key: string;
5 data: any;

emailRandomJokemain.tsx1 match

@gitneukev•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",
tuna

tuna9 file matches

@jxnblk•Updated 1 day ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.