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/image-url.jpg%20%22Image%20title%22?q=fetch&page=1&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 14433 results for "fetch"(5817ms)

No matches found in users.

Try switching to another result type using the tabs above.

proxydatasaver.ts6 matches

@jrc•Updated 6 mins ago
4
5// @ts-ignore - Val Town imports
6import { fetch } from "https://esm.town/v/std/fetch";
7// @ts-ignore - Val Town imports
8import { Readability } from "npm:@mozilla/readability";
103 }
104
105 const response = await fetch(targetUrl, {
106 headers: forwardHeaders,
107 });
109 if (!response.ok) {
110 return new Response(
111 `Failed to fetch: ${response.status} ${response.statusText}`,
112 { status: response.status },
113 );
135 if (!isNaN(parsedContentLength)) {
136 originalSize = parsedContentLength;
137 // If content-length is present and content was encoded (meaning fetch decompressed it),
138 // then originalSize (from Content-Length) represents the compressed size.
139 if (
358 console.error("DataSaver error:", error);
359
360 if (error instanceof TypeError && String(error).includes("fetch")) {
361 return new Response(
362 `Failed to fetch URL: ${targetUrl}. Please check the URL is valid.`,
363 {
364 status: 400,

HelloWorld2hono.ts1 match

@wolf•Updated 7 mins ago
6 });
7
8export default app.fetch;

testWeatherFetcher1 file match

@sjaskeprut•Updated 11 hours ago

weatherFetcher1 file match

@sjaskeprut•Updated 11 hours ago