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=912&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 17277 results for "function"(1709ms)

linkInBioTemplatemain.tsx1 match

@barakaa•Updated 2 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

knowtheweathermain.tsx4 matches

@faarahsaed•Updated 2 months ago
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function WeatherDashboard() {
6 const [location, setLocation] = useState({ latitude: 40.7128, longitude: -74.0060 }); // Default to New York City
7 const [weatherData, setWeatherData] = useState(null);
9
10 useEffect(() => {
11 async function fetchWeather() {
12 try {
13 const response = await fetch(
74}
75
76function client() {
77 createRoot(document.getElementById("root")).render(<WeatherDashboard />);
78}
79if (typeof document !== "undefined") { client(); }
80
81export default async function server(request: Request): Promise<Response> {
82 return new Response(
83 `

syncBookmarksmain.tsx2 matches

@s3thi•Updated 2 months ago
8};
9
10async function getAllBookmarks() {
11 try {
12 const csvExportResponse = await fetch(
28}
29
30export default async function(interval: Interval) {
31 // First delete existing bookmarks.
32 const batchStatements = [{

MissGraceOwusu_1main.tsx4 matches

@MissGrace27•Updated 2 months ago
3import React, { useState } from "https://esm.sh/react@18.2.0";
4
5function ConsultationBookingForm() {
6 const [name, setName] = useState("");
7 const [email, setEmail] = useState("");
126}
127
128function App() {
129 return <ConsultationBookingForm />;
130}
131
132function client() {
133 createRoot(document.getElementById("root")!).render(<App />);
134}
139}
140
141export default async function server(request: Request): Promise<Response> {
142 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
143 const KEY = "MissGraceOwusu_1";

sitTrackerAppmain.tsx3 matches

@olivas20000•Updated 2 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [jobs, setJobs] = useState([]);
7 const [messages, setMessages] = useState([]);
212}
213
214function client() {
215 createRoot(document.getElementById("root")).render(<App />);
216}
217if (typeof document !== "undefined") { client(); }
218
219export default async function server(request: Request): Promise<Response> {
220 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
221 const KEY = "sitTrackerApp";

poeticChocolateMacawmain.tsx5 matches

@blackIT•Updated 2 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function WeatherDashboard() {
6 const [location, setLocation] = useState({ latitude: null, longitude: null });
7 const [weatherData, setWeatherData] = useState(null);
27
28 useEffect(() => {
29 async function fetchWeather() {
30 if (location.latitude && location.longitude) {
31 try {
136}
137
138function App() {
139 return <WeatherDashboard />;
140}
141
142function client() {
143 createRoot(document.getElementById("root")).render(<App />);
144}
145if (typeof document !== "undefined") { client(); }
146
147export default async function server(request: Request): Promise<Response> {
148 return new Response(`
149 <html>

invitationmain.tsx3 matches

@tinyelotito•Updated 2 months ago
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
98}
99
100function client() {
101 createRoot(document.getElementById("root")).render(<App />);
102}
103if (typeof document !== "undefined") { client(); }
104
105export default async function server(request: Request): Promise<Response> {
106 return new Response(
107 `

atadzoePudinAppmain.tsx3 matches

@elaltel•Updated 2 months ago
3import React, { useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
6 const [size, setSize] = useState("500ml");
7 const [quantity, setQuantity] = useState(1);
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) {
227 if (request.method === "POST" && new URL(request.url).pathname === "/submit-order") {
228 const orderDetails = await request.json();

jobBoardAppmain.tsx7 matches

@aiuser254•Updated 2 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function JobPostingForm({ onSubmit }) {
6 const [title, setTitle] = useState("");
7 const [description, setDescription] = useState("");
59}
60
61function JobList({ onReset }) {
62 const [jobs, setJobs] = useState([]);
63 const [error, setError] = useState(null);
129}
130
131function UsernameModal({ onSetUsername }) {
132 const [username, setUsername] = useState("");
133 const [error, setError] = useState("");
170}
171
172function ChatRoom() {
173 const [messages, setMessages] = useState([]);
174 const [newMessage, setNewMessage] = useState("");
287}
288
289function App() {
290 const [refreshJobs, setRefreshJobs] = useState(0);
291
316}
317
318function client() {
319 createRoot(document.getElementById("root")).render(<App />);
320}
321if (typeof document !== "undefined") { client(); }
322
323export default async function server(request: Request): Promise<Response> {
324 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
325 const KEY = "jobBoardApp";

quaintBrownWallabymain.tsx3 matches

@sarittusch•Updated 2 months ago
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
98}
99
100function client() {
101 createRoot(document.getElementById("root")).render(<App />);
102}
103if (typeof document !== "undefined") { client(); }
104
105export default async function server(request: Request): Promise<Response> {
106 return new Response(
107 `

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
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": "*",