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/$%7Burl%7D?q=function&page=2130&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 30516 results for "function"(3444ms)

fabwMultiplayermain.tsx2 matches

@alexwein•Updated 3 months ago
2import { retryFill } from "https://esm.town/v/alexwein/gridRetryFill";
3
4export async function get(req: Request): Promise<Response> {
5 const word = await getRandomWord();
6 return Response.json(word);
7}
8
9export default async function(req: Request): Promise<Response> {
10 const minuteInterval = 3;
11 const seed = Math.floor(Date.now() / (1000 * 60 * minuteInterval)) * minuteInterval;

localTestindex.http.tsx1 match

@maxm•Updated 3 months ago
13
14
15export default async function(req: Request): Promise<Response> {
16 if (req.method === "POST") {
17 await sqlite.execute(`UPDATE ${table} SET count = count + 1 WHERE id = 1`);

progressiveRedBasstest1 match

@shouser•Updated 3 months ago
1export default async function(req: Request): Promise<Response> {
2 throw new Error("hi");
3 return Response.json({ ok: true });

researchAgentemailHandler2 matches

@kamalnrf•Updated 3 months ago
4import { OpenAI } from "npm:openai";
5
6function pm(...lines: string[]): string {
7 return lines.join("\n");
8}
9
10export async function emailValHandler(inboundEmail: Email) {
11 const userPrompt = pm(
12 `From: ${inboundEmail.from}`,

forky-1741889903243App.tsx1 match

@shouser•Updated 3 months ago
2import { useState } from "https://esm.sh/react@18.2.0";
3
4export function App() {
5 const [projectUrl, setProjectUrl] = useState("");
6 const [apiToken, setApiToken] = useState("");

forky-1741889903243index.ts2 matches

@shouser•Updated 3 months ago
121});
122
123function parseValTownProjectURL(url) {
124 // Use the URL constructor to parse the URL
125 const { pathname } = new URL(url);
135}
136
137async function getFilesWithContent(authenticatedVT, files, projectId, newProjectId) {
138 console.log("files:", files);
139 const nonDirectoryFiles = files.filter(file => file.type !== "directory");

researchAgentmorningAiNewsletter1 match

@kamalnrf•Updated 3 months ago
4const { author, name } = extractValInfo(import.meta.url);
5
6export default async function(interval: Interval) {
7 const today = new Intl.DateTimeFormat("en-US", {
8 month: "short",

tank-1741888685515tank.html1 match

@shouser•Updated 3 months ago
1export default function server(request: Request): Response {
2 return new Response(
3 `<!DOCTYPE html>

tank-1741888685515tank.js4 matches

@shouser•Updated 3 months ago
77}
78
79function preload() {}
80
81function setup(faceCount = 20) {
82 createCanvas(windowWidth, windowHeight);
83 console.log("setup");
96}
97
98function draw() {
99 background(0);
100 var i;
106}
107
108function setFaceCount() {
109 faceCount = document.getElementById('faceCount').value;
110 console.log(faceCount)

import_from_githubApp.tsx1 match

@shouser•Updated 3 months ago
2import { useState } from "https://esm.sh/react@18.2.0";
3
4export function App() {
5 const [projectUrl, setProjectUrl] = useState("");
6 const [apiToken, setApiToken] = useState("");
tuna

tuna9 file matches

@jxnblk•Updated 1 week 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.