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=855&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 8855 results for "fetch"(2392ms)

proxyFetch6main.tsx5 matches

@alp•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const proxyFetch6 = async (req, res) => {
4 const { url, options } = req.body;
5 try {
6 const response = await fetch(url, options);
7 return res.status(response.status).send(await response.text());
8 } catch (e) {
9 const errorMessage = e instanceof Error ? e.message : "Unknown error";
10 console.error("Failed to initiate fetch", e);
11 return res.status(500).send(`Failed to initiate fetch: ${errorMessage}`);
12 }
13};

githubFollowingmain.tsx2 matches

@cas•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Github following
4export let githubFollowing = fetchJSON(
5 "https://api.github.com/users/stevekrouse/following"
6);

scrapValuemain.tsx2 matches

@redking00•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const scrapValue = async (url, selector, attr) => {
5 "https://deno.land/x/deno_dom/deno-dom-wasm.ts"
6 );
7 let doc = await (await fetch(url)).text();
8 const document = new DOMParser().parseFromString(doc, "text/html");
9 return document.querySelector(selector).getAttribute(attr);

aqimain.tsx2 matches

@Exam6918•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let aqi = async () => {
4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({

cryptoFearAndGreedIndexmain.tsx2 matches

@chrispie•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export const cryptoFearAndGreedIndex = async () => {
4 const { default: cheerio } = await import("npm:cheerio");
5 const html = await fetchText(
6 "https://alternative.me/crypto/fear-and-greed-index/",
7 );

catFactGettermain.tsx2 matches

@jack•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let catFactGetter = () => {
13};
14
15fetch('https://catfact.ninja/fact?max_length=140', requestOptions)
16 .then(response => response.json())
17 .then(result => {

getRaycastDownloadCountmain.tsx2 matches

@shayne•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const getRaycastDownloadCount = (async () => {
6 );
7 const url = "https://www.raycast.com/tailscale/tailscale";
8 const response = await fetch(url);
9 const html = await response.text();
10 const document = new DOMParser().parseFromString(html, "text/html");

githubStarredmain.tsx2 matches

@dpointeck•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub starred repos
4export let githubStarred = fetchJSON(
5 "https://api.github.com/users/stevekrouse/starred?per_page=10",
6);

valtownForwardermain.tsx2 matches

@neverstew•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { emailWebhookMap } from "https://esm.town/v/neverstew/emailWebhookMap";
3
18 resolve(false);
19 }, 3000);
20 fetch(destination).then((x) => {
21 console.log(`Delivered to ${destination}`);
22 }).catch((x) => {

secretEndpointSuccessmain.tsx2 matches

@neverstew•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const secretEndpointSuccess = fetch(
4 "https://neverstew-secretEndpoint.web.val.run",
5 { headers: { Authorization: "birdsarentreal" } },

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago