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/$%7Burl%7D?q=fetch&page=768&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 8480 results for "fetch"(1538ms)

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};

openstreetmapAPIexamplemain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const openstreetmapAPIexample = (async () => {
4 return (await fetch("https://api.openstreetmap.org/api/0.6/node/1", {
5 headers: { accept: "application/json" },
6 })).json();

notionValLinkTweetmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchTweet } from "https://esm.town/v/dpetrouk/fetchTweet?v=35";
2
3export let notionValLinkTweet =
4 (await fetchTweet(
5 "https://twitter.com/stevekrouse/status/1686075940076449792",
6 )).text;

pollVulkanRSSFeedBugmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { parseXML } from "https://esm.town/v/stevekrouse/parseXML";
3
4export const pollVulkanRSSFeedBug = (async () => {
5 const githubProject = "https://github.com/KhronosGroup/Vulkan-Docs";
6 const response = await fetch(`${githubProject}/commits.atom`);
7 const feed =
8 (await parseXML(await response.text())).feed;

getDiscordMessagesmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { discordFetch } from "https://esm.town/v/stevekrouse/discordFetch";
2
3export let getDiscordMessages = (token, channelId) => discordFetch(
4 token,
5 `channels/${channelId}/messages`,

fetchXMLmain.tsx3 matches

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

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago