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/image-url.jpg%20%22Optional%20title%22?q=function&page=2095&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 29929 results for "function"(2985ms)

tactfulGreenPigeonmain.tsx3 matches

@jarin1425•Updated 3 months ago
3import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
6 const [messages, setMessages] = useState([]);
7 const [input, setInput] = useState("");
93}
94
95function client() {
96 createRoot(document.getElementById("root")).render(<App />);
97}
98if (typeof document !== "undefined") { client(); }
99
100export default async function server(request: Request): Promise<Response> {
101 if (request.method === "POST" && new URL(request.url).pathname === "/chat") {
102 const { OpenAI } = await import("https://esm.town/v/std/openai");

assesmentmain.tsx3 matches

@atharv175•Updated 3 months ago
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function AnalyticsApp() {
6 const [analyticsType, setAnalyticsType] = useState("overall");
7 const [data, setData] = useState(null);
147}
148
149function client() {
150 createRoot(document.getElementById("root")).render(<AnalyticsApp />);
151}
152if (typeof document !== "undefined") { client(); }
153
154export default async function server(request: Request): Promise<Response> {
155 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
156 const KEY = "assesment";

animeStreamingAppmain.tsx8 matches

@HeilAnime•Updated 3 months ago
6const ANIME_API = "https://api.consumet.org/anime/gogoanime/";
7
8function AnimeApp() {
9 const [animes, setAnimes] = useState([]);
10 const [selectedAnime, setSelectedAnime] = useState(null);
12
13 useEffect(() => {
14 async function fetchPopularAnime() {
15 try {
16 const response = await fetch(`${ANIME_API}top`);
24 }, []);
25
26 async function fetchEpisodes(animeId) {
27 try {
28 const response = await fetch(`${ANIME_API}info/${animeId}`);
35 }
36
37 function AnimeCard({ anime }) {
38 return (
39 <div
56 }
57
58 function VideoPlayer({ episode }) {
59 if (!episode) return <div>Select an episode</div>;
60
73 }
74
75 function EpisodeList() {
76 if (!selectedAnime) return null;
77
144}
145
146function client() {
147 createRoot(document.getElementById("root")).render(<AnimeApp />);
148}
149if (typeof document !== "undefined") { client(); }
150
151export default async function server(request: Request) {
152 return new Response(`
153 <html>

webhookbizhoursmain.tsx1 match

@malcolmocean•Updated 3 months ago
1export default async function server(request: Request): Promise<Response> {
2 // Parse the URL to extract query parameters
3 const url = new URL(request.url);

valjsmain.tsx1 match

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

noticiasfidesmain.tsx1 match

@joseforonda•Updated 3 months ago
40};
41
42export default async function(interval: Interval) {
43 let entries: any[] = [];
44 for (let page = 1; page < 4; page++) {

researchAgentmorningAiNewsletter1 match

@saif•Updated 3 months ago
1import { emailValHandler } from "./emailHandler";
2
3export default async function(interval: Interval) {
4 const today = new Intl.DateTimeFormat("en-US", {
5 month: "short",

researchAgentemailHandler2 matches

@saif•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}`,

chatmain.tsx1 match

@sandy•Updated 3 months ago
1export default async function askChatGPT(prompt: string) {
2 const apiKey = "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"; // Use straight quotes
3

Himain.tsx5 matches

@Amir7787•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function CelebrationOverlay() {
6 return (
7 <div className="celebration-overlay">
12}
13
14function WishForm({ onSubmit }) {
15 const [wish, setWish] = useState({
16 name: '',
67}
68
69function App() {
70 const [memories, setMemories] = useState([]);
71 const [selectedMemory, setSelectedMemory] = useState(null);
219}
220
221function client() {
222 createRoot(document.getElementById("root")).render(<App />);
223}
224if (typeof document !== "undefined") { client(); }
225
226export default async function server(request: Request): Promise<Response> {
227 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
228 const KEY = "Hi";
tuna

tuna9 file matches

@jxnblk•Updated 5 days 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.