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=550&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 7881 results for "fetch"(1478ms)

test_migratedREADME.md1 match

@jxnblk•Updated 9 months ago
163. Import `describe` and `it` utilities
174. Write tests
185. Add the badge to your readme, with the `url` parameter pointing to the test suite val's endpoint. Tests run whenever the test suite val or the badge is fetched
19
20```tsx

caniuse_notifiermain.tsx3 matches

@gunnnnii•Updated 9 months ago
32
33 const url = "https://raw.githubusercontent.com/Fyrd/caniuse/main/fulldata-json/data-1.0.json";
34 const data = await fetch(url).then((res) => res.json());
35 const updatedAt = data.updated;
36
37 if (previousDataUpdatedAt >= updatedAt) return;
38
39 const fetchedFeatures = Object.keys(data.data);
40
41 const features = [];
42 for (const feature of fetchedFeatures) {
43 const previousFeature = previousData?.[feature];
44 const previousUsage = previousFeature?.usage_perc_y ?? 0;

blurbsmain.tsx4 matches

@yawnxyz•Updated 9 months ago
78const getContent = async (url: string) => {
79 try {
80 const response = await fetch(`https://r.jina.ai/${url}`);
81 if (!response.ok) {
82 throw new Error(`HTTP error! Status: ${response.status}`);
85 return data;
86 } catch (error) {
87 console.error('Error fetching the URL:', error);
88 return 'Error fetching the content.';
89 }
90};
130});
131
132export default app.fetch;

sqliteAdminmain.tsx4 matches

@kamalnrf•Updated 9 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

MinnehahaFlowLevelmain.tsx2 matches

@judson•Updated 9 months ago
65
66 try {
67 const response = await fetch(url);
68 if (!response.ok) {
69 throw new Error(`HTTP error! status: ${response.status}`);
72 return data; // Store the JSON data in a variable
73 } catch (error) {
74 console.error("Error fetching data:", error);
75 }
76}

emailmain.tsx1 match

@std•Updated 9 months ago
68 headers?: Record<string, string>;
69}) => {
70 let result = await fetch(
71 `${API_URL}/v1/email`,
72 {

Fetchmain.tsx1 match

@hunty•Updated 9 months ago
10});
11
12export default app.fetch;

date_me_formmain.tsx2 matches

@stevekrouse•Updated 9 months ago
4import date_me_doc_locations from "https://esm.town/v/stevekrouse/date_me_doc_locations";
5import Layout from "https://esm.town/v/stevekrouse/dateme_layout";
6import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
7import { Hono } from "npm:hono@3";
8
224form.get("/", Form);
225form.post("/", Submit);
226export default reloadOnSaveFetchMiddleware(form.fetch);

getValsContextWindowDebugmain.tsx1 match

@janpaul123•Updated 9 months ago
1// This val renders the output of "janpaul123/getValsContextWindow" as HTML
2// It uses React for rendering and includes a <select> for the "model" option
3// The approach is to fetch the context window data, then render it as an interactive HTML page
4
5/** @jsxImportSource https://esm.sh/react */

VALLErunmain.tsx2 matches

@roadlabs•Updated 9 months ago
189 code: newCode,
190 });
191 fetch('/save', { method: "POST", body }).then(() => {
192 document.getElementById('code-input-hidden').value = newCode;
193 document.getElementById('preview-iframe').src += '';
505 app.post("/", mainHandler);
506
507 return passwordAuth(app.fetch, { verifyPassword: verifyToken });
508}

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago