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=762&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 8425 results for "fetch"(1273ms)

fetchRSSmain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { parseXML } from "https://esm.town/v/stevekrouse/parseXML";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
3
4export const fetchRSS = (url: string) =>
5 fetchText(url)
6 .then(parseXML)
7 .then(({ rss }) => rss);

convertCurrencymain.tsx3 matches

@frankdilo•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let convertCurrency = async (desired, base = "usd", amount = 1) => {
4 let { rates } = await fetchJSON(
5 `https://open.er-api.com/v6/latest/${base}`,
6 );
8 return amount * (rates[desired.toUpperCase()]);
9 else {
10 let { rates } = await fetchJSON(
11 "https://api.coingecko.com/api/v3/exchange_rates",
12 );

valmain.tsx2 matches

@neverstew•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function val({ token, id }: {
29 }
30 : {};
31 return fetchJSON(
32 "https://api.val.town/v1/vals/" + id,
33 { headers },

runmain.tsx2 matches

@pomdtr•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { parseAuthorizationHeader } from "https://esm.town/v/pomdtr/parseAuthorizationHeader";
3
27 }
28 }
29 const resp = await fetch(url.toString(), {
30 method: req.method,
31 body: body || undefined,

storeTodaysDatemain.tsx2 matches

@tal•Updated 1 year ago
1import { fetchAndStore } from "https://esm.town/v/tal/fetchAndStore";
2import { currentDateValues } from "https://esm.town/v/tal/currentDateValues";
3
4export let storeTodaysDate = (async () => {
5 const today = currentDateValues();
6 await fetchAndStore({
7 ...today,
8 menuType: "pre-k---8-lunch-menu",

paginateAPImain.tsx3 matches

@andreterron•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const paginateAPI = async (
4 url: string,
5 options: Parameters<typeof fetch>[1],
6) => {
7 let result: any[] = [];
8 let nextUrl = url;
9 while (nextUrl) {
10 const { data, links } = await fetchJSON(
11 nextUrl,
12 options,

honoGameTestmain.tsx1 match

@andreterron•Updated 1 year ago
9 return c.html(html`<div style="background-color: pink;">Hello!</div>`);
10 });
11 return app.fetch(req);
12}

sendToPushDeermain.tsx2 matches

@LavaC•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { pushDeerKey } from "https://esm.town/v/LavaC/pushDeerKey";
3
4export let sendToPushDeer = async (msg = "this is a test msg") => {
5 let key = pushDeerKey;
6 await fetch(
7 `https://api2.pushdeer.com/message/push?pushkey=${key}&text=${msg}`
8 );

starWarsmain.tsx2 matches

@dexa•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);

emojiWebmain.tsx1 match

@jdan•Updated 1 year ago
71 );
72 });
73 return app.fetch(req);
74};

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago