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=2482&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 34083 results for "function"(12601ms)

generateTurtleNamemain.tsx2 matches

@ajax•Updated 4 months ago
2import { generateText } from "npm:ai";
3
4export default async function generateTurtleName(req: Request): Promise<Response> {
5 if (req.method !== "POST") {
6 return Response.json({ message: "This function responds to POST requests." }, {
7 status: 400,
8 });

philosophicalRoseCanidaemain.tsx3 matches

@ajax•Updated 4 months ago
15];
16
17function generateTurtleName(baseIdea?: string): { name: string; explanation: string } {
18 const randomElement = (arr: string[]) => arr[Math.floor(Math.random() * arr.length)];
19
50}
51
52export default async function(req: Request): Promise<Response> {
53 if (req.method !== "POST") {
54 return new Response(JSON.stringify({ message: "This function responds to POST requests." }), {
55 status: 400,
56 headers: { "Content-Type": "application/json" }

generate_turtle_namemain.tsx2 matches

@ajax•Updated 4 months ago
2import { generateText } from "npm:ai";
3
4export default async function(req: Request): Promise<Response> {
5 if (req.method !== "POST") {
6 return Response.json({ message: "This function responds to POST requests." }, {
7 status: 400,
8 });

explain_like_im_25main.tsx2 matches

@ajax•Updated 4 months ago
2import { generateText } from "npm:ai";
3
4export default async function(req: Request): Promise<Response> {
5 if (req.method !== "POST") {
6 return Response.json({ message: "This function responds to POST requests only." }, {
7 status: 400,
8 });

explain_like_im_150main.tsx2 matches

@ajax•Updated 4 months ago
2import { generateText } from "npm:ai";
3
4export default async function(req: Request): Promise<Response> {
5 if (req.method !== "POST") {
6 return Response.json({ message: "This function responds to POST requests only." }, {
7 status: 400,
8 });

explain_like_im_fivemain.tsx2 matches

@ajax•Updated 4 months ago
1import { openai } from "npm:@ai-sdk/openai"; // Ensure OPENAI_API_KEY environment variable is set
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method !== "POST") {
5 return Response.json({ message: "This function responds to POST requests." }, {
6 status: 400,
7 });

statusnotify1 match

@wilg•Updated 4 months ago
4const thisURL = parseProject(import.meta.url).links.self.latest;
5
6export async function notify(message: string) {
7 await email({ subject: message, text: `Email sent from ${thisURL}` });
8}

tidyPlumBonobomain.tsx3 matches

@SIR_FESTUS•Updated 4 months ago
5// Rest of the existing game code remains the same...
6
7function App() {
8 const [isInstallable, setIsInstallable] = useState(false);
9 const [deferredPrompt, setDeferredPrompt] = useState(null);
88}
89
90function client() {
91 createRoot(document.getElementById("root")).render(<App />);
92
107if (typeof document !== "undefined") { client(); }
108
109export default async function server(request: Request): Promise<Response> {
110 return new Response(`
111 <html>

honoStarterApp.tsx1 match

@nbbaier•Updated 4 months ago
2import { useState } from "https://esm.sh/react@18.2.0";
3
4export function App() {
5 const [clicked, setClicked] = useState(0);
6 return (

projectConverterDraftindex.ts1 match

@charmaine•Updated 4 months ago
37 }
38
39 // Import the converter function dynamically
40 const { convertValToProject } = await import("./converter.ts");
41

discordWebhook2 file matches

@stevekrouse•Updated 1 week ago
Helper function to send Discord messages
tuna

tuna9 file matches

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