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=31&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"(1185ms)

live-reload4demo.tsx1 match

@dcm31•Updated 3 days ago
40});
41
42export default liveReload(app.fetch, import.meta.url);

live-reload5utils.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-reload5README.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-reload5error-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-reload5client.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;

WillpersonalWebsiteabout1 match

@willthereader•Updated 3 days ago
72const app = new Hono();
73app.get("/", about);
74export default app.fetch;

live-reload4utils.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-reload4README.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-reload4error-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-reload4client.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;

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago