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=682&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 7880 results for "fetch"(1408ms)

untitled_harlequinDingomain.tsx3 matches

@juwang110•Updated 1 year ago
1async function emailRandomJoke() {
2 async function fetchRandomJoke() {
3 const response = await fetch(
4 "<https://official-joke-api.appspot.com/random_joke>",
5 );
7 }
8
9 const randomJoke = await fetchRandomJoke();
10 const setup = randomJoke.setup;
11 const punchline = randomJoke.punchline;

getVersionmain.tsx1 match

@jpwilliams•Updated 1 year ago
12 headers.set("accept", "application/vnd.github.v3+json");
13
14 const res = await fetch(targetUrl, { headers });
15 const release = await res.json();
16

nicoFunctionScriptmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://val.town/v/stevekrouse/fetchJSON";
2
3await fetchJSON("/1");
4const a = (x) => x + 1;
5const b = (y) => a(y);

whiteCondormain.tsx2 matches

@simonwalsh•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Activity suggestions for when you're bored
4export const whiteCondor = fetchJSON(
5 "https://www.boredapi.com/api/activity",
6);

flightRadar24main.tsx2 matches

@raylu•Updated 1 year ago
1import { persistence } from "https://esm.town/v/raylu/persistence";
2import { fetch } from "https://esm.town/v/std/fetch";
3import { set } from "https://esm.town/v/std/set?v=11";
4import { discordSendDM } from "https://esm.town/v/vtdocs/discordSendDM?v=6";
15 "https://deno.land/x/deno_dom/deno-dom-wasm.ts"
16 );
17 const response = await fetch(url);
18 const html = await response.text();
19 return new DOMParser().parseFromString(html, "text/html");

honoJSXmain.tsx1 match

@stevekrouse•Updated 1 year ago
29 return c.html(<Top messages={messages} />);
30});
31export let honoJSX = app.fetch;

honoExamplemain.tsx1 match

@stevekrouse•Updated 1 year ago
4app.get('/', c => c.text("Hello Hono!"))
5
6export const honoExample = app.fetch

zaobaomain.tsx1 match

@baj•Updated 1 year ago
2
3export async function zaobao() {
4 const res = await fetch(
5 `https://chrome.browserless.io/content?token=${process.env.browserlessKey}`,
6 {

browserlessScrapeExamplemain.tsx2 matches

@baj•Updated 1 year ago
1// import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2import process from "node:process";
3
4export const browserlessScrapeExample = (async () => {
5 try {
6 const res = await fetch(
7 `https://chrome.browserless.io/scrape?token=${process.env.browserlessKey}`,
8 {

handlermain.tsx2 matches

@maxjoygit•Updated 1 year ago
9app.post("/test", (c) => c.text("Hello Lagon test ppost!"));
10
11export const handler = app.fetch;
12
13// export const honoExample = async (req: Request) => {
16// app.get("/", (c) => c.text("Hono?"));
17// app.get("/yeah", (c) => c.text("Routing!"));
18// return app.fetch(req);
19// };

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago