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=966&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 15007 results for "function"(2179ms)

fortuitousVioletLeopardadmirableGreenMink1 match

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

TestprojectfineRoseSquirrel1 match

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

yc_findermain.tsx5 matches

@reetkumarbind•Updated 2 months ago
23`;
24
25function Hero() {
26 return (
27 <div className="hero">
32}
33
34function HowItWorks() {
35 return (
36 <div className="how-it-works">
53}
54
55function App() {
56 const [ycCompanies, setYcCompanies] = useState<YCCompany[]>([]);
57 const [mergedData, setMergedData] = useState<any[]>([]);
217}
218
219function client() {
220 createRoot(document.getElementById("root")!).render(<App />);
221}
225}
226
227export default async function server(request: Request): Promise<Response> {
228 const companies = await fetch("https://stevekrouse-yc_database.web.val.run").then(res => res.json());
229 const url = new URL(request.url);

easygoingEmeraldGamefowlmain.tsx1 match

@toowired•Updated 2 months ago
69
70// Export for Val Town
71export async function test(args) {
72 return await runTests();
73}

exceptionalBlushCarpmain.tsx7 matches

@toowired•Updated 2 months ago
1import { blob } from '@val.town/utils';
2
3export async function windsurfIDE(args) {
4 const { type, ...params } = args;
5
22}
23
24async function handleStartGoal(goal) {
25 const state = await blob.get('windsurf_state') || {
26 goals: [],
58}
59
60async function handleCompleteTask(taskId) {
61 const state = await blob.get('windsurf_state');
62 if (!state) return { error: 'No active state' };
82}
83
84async function handleAutoNext() {
85 const state = await blob.get('windsurf_state');
86 if (!state || !state.currentGoal) return { status: "NO_ACTIVE_GOAL" };
116}
117
118async function loadMemory(memoryId) {
119 const state = await blob.get('windsurf_state');
120 if (!state) return { error: 'No active state' };
136}
137
138async function applyRule(rule, target, state) {
139 // Rule application logic
140 switch(rule.action) {
155}
156
157function prioritizeTask(task, state, criteria) {
158 // Task prioritization logic based on rules
159 return task;

luminousOrangeDingomain.tsx1 match

@toowired•Updated 2 months ago
69
70// Export for Val Town
71export async function test(args) {
72 return await runTests();
73}

tangibleBrownPtarmiganmain.tsx7 matches

@toowired•Updated 2 months ago
1import { blob } from '@val.town/utils';
2
3export async function windsurfIDE(args) {
4 const { type, ...params } = args;
5
22}
23
24async function handleStartGoal(goal) {
25 const state = await blob.get('windsurf_state') || {
26 goals: [],
58}
59
60async function handleCompleteTask(taskId) {
61 const state = await blob.get('windsurf_state');
62 if (!state) return { error: 'No active state' };
82}
83
84async function handleAutoNext() {
85 const state = await blob.get('windsurf_state');
86 if (!state || !state.currentGoal) return { status: "NO_ACTIVE_GOAL" };
116}
117
118async function loadMemory(memoryId) {
119 const state = await blob.get('windsurf_state');
120 if (!state) return { error: 'No active state' };
136}
137
138async function applyRule(rule, target, state) {
139 // Rule application logic
140 switch(rule.action) {
155}
156
157function prioritizeTask(task, state, criteria) {
158 // Task prioritization logic based on rules
159 return task;

bubblyMaroonLungfishmain.tsx1 match

@toowired•Updated 2 months ago
69
70// Export for Val Town
71export async function test(args) {
72 return await runTests();
73}

alluringSapphireStoatmain.tsx1 match

@toowired•Updated 2 months ago
69
70// Export for Val Town
71export async function test(args) {
72 return await runTests();
73}

Windsurfcontextmanager4 matches

@toowired•Updated 2 months ago
16
17// Context Manager Val
18export async function updateContext(context) {
19 const { phase, activeBlocks, pendingTasks, recentChanges } = context;
20
35}
36
37export async function getLatestContext() {
38 const result = db.prepare(`
39 SELECT * FROM context
53}
54
55export async function getContextHistory(limit = 10) {
56 return db.prepare(`
57 SELECT * FROM context
62
63// HTTP request handler
64export async function onRequest(req) {
65 const { action, params } = await req.json();
66

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 week 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": "*",