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/$%7Bsuccess?q=function&page=97&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 20424 results for "function"(2886ms)

beeGPTindex.tsx2 matches

@armadillomike•Updated 2 days ago
16
17// Bee-themed image prompt enhancer
18function enhanceImagePrompt(userPrompt: string): string {
19 const prompt = userPrompt.trim();
20
39}
40
41export default async function(req: Request): Promise<Response> {
42 const url = new URL(req.url);
43

embed-servicestests.tsx1 match

@temptemp•Updated 2 days ago
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 url.host = `02c3dc47-4c6a-4818b-84ae-d22210c9d4cb.cloudflarepreviews.com`;

beeAiindex.ts2 matches

@armadillomike•Updated 2 days ago
16
17// Bee-themed image prompt enhancer
18function enhanceImagePrompt(userPrompt: string): string {
19 const prompt = userPrompt.trim();
20
39}
40
41export default async function(req: Request): Promise<Response> {
42 const url = new URL(req.url);
43

untitled-8878README.md1 match

@Fina•Updated 2 days ago
13## Technical Details
14
15- Built with Leaflet.js for mapping functionality
16- Uses OpenStreetMap as the base map layer
17- Styled with Tailwind CSS

untitled-8878ghana-map.ts1 match

@Fina•Updated 2 days ago
1export default async function(req: Request) {
2 // HTML content with Ghana map using Leaflet.js
3 const html = `<!DOCTYPE html>

embed-servicesmax-cron.tsx1 match

@temptemp•Updated 2 days ago
11`;
12const text = "";
13export default async function(interval: Interval) {
14 const key = "c73e2da1cd6ea3e13c52cf3b662368ed39199f6e8144facc9bd13f2da7addd30";
15 const uuid = "02c3dc47-4c6a-4818b-84ae-d22210c9d4cb";

Bee_AIindex.tsx3 matches

@quartex•Updated 2 days ago
16}
17
18function App() {
19 const [question, setQuestion] = useState("");
20 const [messages, setMessages] = useState<Message[]>([]);
229}
230
231function client() {
232 createRoot(document.getElementById("root")).render(<App />);
233}
234if (typeof document !== "undefined") { client(); }
235
236export default async function server(request: Request): Promise<Response> {
237 if (request.method === "POST") {
238 const { OpenAI } = await import("https://esm.town/v/std/openai");

ExperimentalMain.tsx11 matches

@Get•Updated 2 days ago
137}
138
139// --- callOpenAI Function ---
140async function callOpenAI(
141 sysPrompt: string,
142 userPrompt: string,
649}
650
651// --- Agent Functions ---
652async function runCntAgent(task: TskIn<CntIn>, logFn: LogFn): Promise<TskOut<CntOut>> {
653 const { mid, tid, p } = task;
654 logFn(
702 }
703}
704async function runStratAgent(task: TskIn<StratIn>, logFn: LogFn): Promise<TskOut<StratOut>> {
705 const { mid, tid, p } = task;
706 const platsStr = Array.isArray(p.plats) ? p.plats.join(", ") : "N/A";
752 }
753}
754async function runLogoAgent(task: TskIn<LogoIn>, logFn: LogFn): Promise<TskOut<LogoOut>> {
755 const { mid, tid, p } = task;
756 logFn(
827 }
828}
829async function runBrandAgent(task: TskIn<BrandIn>, logFn: LogFn): Promise<TskOut<BrandOut>> {
830 const { mid, tid, p } = task;
831 logFn(
893 }
894}
895async function runSimAgent(task: TskIn<SimIn>, logFn: LogFn): Promise<TskOut<SimOut>> {
896 const { mid, tid, p } = task;
897 let paramDesc = "N/A";
956 }
957}
958async function runMetaAgent(task: TskIn<MetaIn>, logFn: LogFn): Promise<TskOut<MetaOut>> {
959 const { mid, tid, p } = task;
960 logFn("INFO", "MetaAgent", `Starting meta-prompt gen/refine tid=${tid}`, { inputLen: p.pInput.length }, mid, tid);
1058// --- HTML Generation ---
1059
1060function generateOrthogonalUI(): string {
1061 // generate HTML here
1062 return `<!DOCTYPE html><html><head><title>Orthogonal UI</title></head><body><h1>Orthogonal UI</h1></body></html>`;
1063}
1064// --- Main Request Handler ---
1065export default async function(req: Request): Promise<Response> {
1066 const reqId = `req-${Date.now()}-${Math.random().toString(36).substring(2, 7)}`;
1067 const reqLogger = new LogAgent(reqId);

testindex.ts1 match

@ofird•Updated 2 days ago
1export default function handler(req: Request) {
2 const html = `<!DOCTYPE html>
3<html lang="en">

untitled-1766new-file-7292.tsx1 match

@Gj64•Updated 2 days ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 3 weeks ago
Simple functional CSS library for Val Town
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.