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=fetch&page=935&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 13945 results for "fetch"(2553ms)

statusmonitor2 matches

@nickynole•Updated 3 months ago
15 const start = performance.now();
16 try {
17 res = await fetch(url);
18 end = performance.now();
19 status = res.status;
25 } catch (e) {
26 end = performance.now();
27 reason = `couldn't fetch: ${e}`;
28 ok = false;
29 }

brainrotdepsmain.tsx1 match

@stainless_em•Updated 3 months ago
5 "https://deno.bundlejs.com/?file&text=export%20%7Bdefault%20as%20toIt%7D%20from%20%22browser-readablestream-to-it%22;%0Aexport%20%7Bdefault%20as%20jsonpatch%7D%20from%20%22fast-json-patch@3.1.1%22;%0Aexport%20%7B%20TextLineStream%20%7D%20from%20%22https://esm.sh/jsr/@std/streams@1.0.9/text_line_stream%22;%0Aimport%20*%20as%20preact%20from%20%22preact@10%22;%0Aimport%20*%20as%20preactHooks%20from%20%22preact@10/hooks%22;%0Aimport%20%7Bjsx%20as%20jsx_,%20jsxs%20as%20jsxs_,%20Fragment%20as%20Fragment_%7D%20from%20%22preact@10/jsx-runtime%22;%0Aexport%20const%20React%20=%20%7B...preact,%20...preactHooks%7D%0Aexport%20let%20jsx%20=%20jsx_,%20jsxs%20=%20jsxs_,%20Fragment%20=%20Fragment_%0Aexport%20function%20setJsx(jsx_,%20jsxs_,%20Fragment_)%20%7B%0A%20%20jsx%20=%20jsx_,%20jsxs%20=%20jsxs_,%20Fragment%20=%20Fragment_%0A%7D";
6 return `/*\nbundled version of this:\n\`\`\`js\n${new URL(url).searchParams.get("text")}\n\`\`\`\n*/\n\n`
7 + await (await fetch(url)).text();
8}, import.meta.url);
9export default httpCache(async function(req: Request): Promise<Response> {

superPeachParrotfishmain.tsx12 matches

@nadaamiinn•Updated 3 months ago
11 e.preventDefault();
12 try {
13 const response = await fetch("/api/job-postings", {
14 method: "POST",
15 headers: { "Content-Type": "application/json" },
121 useEffect(() => {
122 if (username) {
123 fetchMessages();
124 const interval = setInterval(fetchMessages, 5000);
125 return () => clearInterval(interval);
126 }
127 }, [username]);
128
129 const fetchMessages = async () => {
130 try {
131 const response = await fetch("/api/chat-messages");
132 const data = await response.json();
133 setMessages(data);
134 } catch (error) {
135 console.error("Error fetching messages", error);
136 }
137 };
140 e.preventDefault();
141 try {
142 const response = await fetch("/api/chat-messages", {
143 method: "POST",
144 headers: { "Content-Type": "application/json" },
150 if (response.ok) {
151 setNewMessage("");
152 fetchMessages();
153 }
154 } catch (error) {
210
211 useEffect(() => {
212 const fetchJobs = async () => {
213 try {
214 const response = await fetch("/api/job-postings");
215 const data = await response.json();
216 setJobs(data);
217 } catch (error) {
218 console.error("Error fetching jobs", error);
219 }
220 };
221 fetchJobs();
222 }, []);
223

tsEvaltsEval1 match

@tmcw•Updated 3 months ago
55});
56
57export default app.fetch.bind(app);

sendTwilioConversationMessagemain.tsx1 match

@vawogbemi•Updated 3 months ago
12 params.append("author", author);
13
14 const response = await fetch(url, {
15 method: "POST",
16 headers: {
94
95 try {
96 const response = await fetch("/identify", {
97 method: "POST",
98 body: formData,
74 formData.append('audio', audioBlob, 'audio.wav');
75
76 const response = await fetch('/classify', {
77 method: 'POST',
78 body: formData

listGuestsMainPagemain.tsx2 matches

@izabayomucyo35p•Updated 3 months ago
8
9 useEffect(() => {
10 fetch('/guests')
11 .then(response => response.json())
12 .then(data => {
15 })
16 .catch(error => {
17 console.error('Error fetching guests:', error);
18 setLoading(false);
19 });

Translation_Trends_Monitor_2025main.tsx4 matches

@AyaMekki8•Updated 3 months ago
69
70 useEffect(() => {
71 async function fetchSkillTrends() {
72 try {
73 const response = await fetch('/skill-trends');
74 const data = await response.json();
75
87 }
88
89 fetchSkillTrends();
90 const interval = setInterval(fetchSkillTrends, 60 * 60 * 1000); // Refresh every hour
91 return () => clearInterval(interval);
92 }, []);

taskManagerAppmain.tsx8 matches

@DeeGemini•Updated 3 months ago
12 const handleSubmit = async (e) => {
13 e.preventDefault();
14 const response = await fetch("/submit-task", {
15 method: "POST",
16 headers: { "Content-Type": "application/json" },
104 const [tasks, setTasks] = useState([]);
105
106 const fetchTasks = async () => {
107 const response = await fetch("/get-tasks");
108 const data = await response.json();
109 setTasks(data);
111
112 const updateTaskStatus = async (taskId, newStatus) => {
113 const response = await fetch("/update-task-status", {
114 method: "POST",
115 headers: { "Content-Type": "application/json" },
117 });
118 if (response.ok) {
119 fetchTasks();
120 }
121 };
122
123 const deleteTask = async (taskId) => {
124 const response = await fetch("/delete-task", {
125 method: "POST",
126 headers: { "Content-Type": "application/json" },
128 });
129 if (response.ok) {
130 fetchTasks();
131 }
132 };
133
134 useEffect(() => {
135 fetchTasks();
136 }, []);
137

FetchBasic2 file matches

@ther•Updated 4 days ago

GithubPRFetcher

@andybak•Updated 1 week ago