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=918&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 18189 results for "function"(5065ms)

Himain.tsx5 matches

@Amir7787•Updated 1 month 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";

aqimain.tsx1 match

@Shaheer•Updated 1 month ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "downtown brooklyn"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

lovingBeigeMeerkatmain.tsx3 matches

@Fodencity365•Updated 1 month ago
11];
12
13function App() {
14 const [paragraph, setParagraph] = useState(paragraphs[0]);
15
75};
76
77function client() {
78 createRoot(document.getElementById("root")).render(<App />);
79}
80if (typeof document !== "undefined") { client(); }
81
82export default async function server(request: Request) {
83 return new Response(`
84 <html>

MEMORY_MASTERmain.tsx3 matches

@AryanSingh•Updated 1 month ago
10};
11
12function MemoryGame() {
13 const [difficulty, setDifficulty] = useState("medium");
14 const [theme, setTheme] = useState("fruits");
220}
221
222function client() {
223 createRoot(document.getElementById("root")).render(<MemoryGame />);
224}
225if (typeof document !== "undefined") { client(); }
226
227export default async function server(request: Request): Promise<Response> {
228 return new Response(
229 `

ask_a_philosophermain.tsx1 match

@ajax•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 return Response.json({ message: "Life is something something", dumb_idea: "Maybe life will hurt a bit" });
3}

facebookCodeSammain.tsx5 matches

@roysarajit143•Updated 1 month ago
22
23// Inline components to replace lazy loading
24function ChatWindow({ messages }: { messages: any[] }) {
25 return (
26 <div style={{
40}
41
42function CallModal({ call }: { call: { type: string, status: string, participants: string[] } }) {
43 return (
44 <div style={{
58}
59
60function SocialMediaAdvanced() {
61 // Consolidated state management
62 const [state, setState] = useState({
245}
246
247function client() {
248 // Use createRoot with concurrent mode for better performance
249 const root = createRoot(document.getElementById("root")!);
260}
261
262export default async function server(request: Request): Promise<Response> {
263 return new Response(`
264 <html>

some_other_bullshitmain.tsx1 match

@ajax•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 return Response.json({ message: "love you, get rekt though", dumb_idea: "aasdasdasd" });
3}

professionalIvoryPandamain.tsx1 match

@ajax•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 return Response.json({ message: "love you, get rekt though, this is somethign else", dumb_idea: "aasdasdasd" });
3}

distinguishedGrayLampreymain.tsx5 matches

@roysarajit143•Updated 1 month ago
4
5// Simulated authentication and user management
6function AuthContext() {
7 const [user, setUser] = useState(null);
8 const [token, setToken] = useState(null);
37
38// Main Chat Component
39function ChatApp() {
40 const [messages, setMessages] = useState([]);
41 const [newMessage, setNewMessage] = useState("");
134}
135
136function LoginForm({ onLogin }) {
137 const [username, setUsername] = useState("");
138 const [password, setPassword] = useState("");
165}
166
167function client() {
168 createRoot(document.getElementById("root")).render(<ChatApp />);
169}
170if (typeof document !== "undefined") { client(); }
171
172export default async function server(request: Request): Promise<Response> {
173 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
174 const KEY = "distinguishedGrayLamprey";

call_some_slop__is_it_workingmain.tsx1 match

@ajax•Updated 1 month ago
1export default async function(req: Request): Promise<Response> {
2 return Response.json({ message: "love you, get rekt though", dumb_idea: "aasdasdasd" });
3}

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",