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/$%7Bart_info.art.src%7D?q=fetch&page=32&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 8150 results for "fetch"(1176ms)

live-reload3utils.ts3 matches

@dcm31•Updated 3 days ago
93}
94/**
95 * Creates a wrapper around a fetch handler that injects an HTML string
96 * into the document. It first checks for a <body> tag; if missing,
97 * it looks for an <html> tag. If neither are present, it appends to
98 * the full text response.
99 *
100 * @param handler The original fetch handler function
101 * @param html The HTML content to inject
102 * @returns A new fetch handler with HTML rewriting
103 */
104export function injectHTML(

live-reload3README.md2 matches

@dcm31•Updated 3 days ago
20import { liveReload } from "https://esm.town/v/stevekrouse/live-reload/main.ts";
21
22const handler = (req: Request) => { /* your fetch handler */}
23export default liveReload(handler, import.meta.url);
24```
59
60// Enable live reloading
61export default liveReload(app.fetch, import.meta.url);
62```
63

live-reload3error-proxy.ts1 match

@dcm31•Updated 3 days ago
7 return new Response(`Learn more at https://www.val.town/x/stevekrouse/live-reload`);
8 }
9 const resp = await fetch(targetURL, {
10 headers: req.headers,
11 });

live-reload3client.ts2 matches

@dcm31•Updated 3 days ago
6 */
7async function registerLongPoll({ pageLoadedAt }: { pageLoadedAt: number }) {
8 const { lastUpdatedAt, status } = await (await fetch("/__lastUpdatedAt")).json();
9 if (lastUpdatedAt > pageLoadedAt) {
10 window.location.href = `https://reload.val.run?${new URLSearchParams({ url: window.location.href })}`;
28 return;
29 }
30 const resp = await fetch(targetURL);
31 if (resp.ok) {
32 window.location.href = targetURL;

live-reload2demo.tsx1 match

@dcm31•Updated 3 days ago
20
21 useEffect(() => {
22 fetch(
23 "https://api.open-meteo.com/v1/forecast?latitude=37.7749&longitude=-122.4194&current=temperature_2m,weathercode",
24 )

WillpersonalWebsitehomepage1 match

@willthereader•Updated 3 days ago
129app.get("/ImOKTheBullIsDead", ImOKTheBullIsDead);
130
131export default app.fetch;

WillpersonalWebsitepersonalWebsite1 match

@willthereader•Updated 3 days ago
44app.get("/ImOKTheBullIsDead", ImOKTheBullIsDead);
45
46export default app.fetch;
142const app = new Hono();
143app.get("/", Time_Blindness_Loud_Calendar_via_iOS_shortcuts);
144export default app.fetch;

WillpersonalWebsiteDebugging_Guide1 match

@willthereader•Updated 3 days ago
95const app = new Hono();
96app.get("/", Debugging_Guide);
97export default app.fetch;
56const app = new Hono();
57app.get("/", Bringing_My_OCD_Online);
58export default app.fetch;

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago