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/$%7Bsuccess?q=fetch&page=752&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 8361 results for "fetch"(1918ms)

proxyFetch8main.tsx5 matches

@alp•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const proxyFetch8 = 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};

thedyslexicdeveloperTikTokmain.tsx2 matches

@chrislaughlin•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export const thedyslexicdeveloperTikTok = (async () => {
4 const cheerio = await import("npm:cheerio");
5 const html = await fetchText(
6 `https://www.tiktok.com/@thedyslexicdeveloper`,
7 );

fetchGHRepoInfomain.tsx3 matches

@noartem•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchGHRepoInfo(userName, repoName) {
4 const response = await fetch(`https://ungh.cc/repos/${userName}/${repoName}`);
5 return await response.json();
6}

GenerateQRmain.tsx1 match

@ramkarthik•Updated 1 year ago
1// fetch("https://api.val.town/v1/express/ramkarthik.GenerateQR?url={url}"
2export async function GenerateQR(req, res) {
3 const url = req.query.url;

weathermain.tsx2 matches

@marcel•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const weather = async (city: string): Promise<unknown> => {
4 let data = await fetch(`https://wttr.in/${city}?format=j1`);
5 return data.json();
6};

githubStarredmain.tsx2 matches

@jian•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"
6);

githubStarredmain.tsx2 matches

@potherca•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub starred repos
4export let githubStarred = fetchJSON("https://api.github.com/users/potherca/starred")
5 .then((repos) => repos.map((repo) => repo.html_url));

testcase1main.tsx2 matches

@charles2•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let testcase1 = fetchJSON('https://api.val.town/eval/@stevekrouse.example1')
4

buildReactDomMinifiedmain.tsx2 matches

@liamdanielduffy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { REACT_DOM_MINIFIED } from "https://esm.town/v/liamdanielduffy/REACT_DOM_MINIFIED";
3let { REACT_DOM_MINIFIED_PT4 } = await import("https://esm.town/v/liamdanielduffy/REACT_DOM_MINIFIED_PT4");
7
8export async function buildReactDomMinified() {
9 const res = await fetch(
10 "https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js",
11 );

buildReactMinifiedmain.tsx2 matches

@liamdanielduffy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3let { REACT_MINIFIED } = await import("https://esm.town/v/liamdanielduffy/REACT_MINIFIED");
4
5export async function buildReactMinified() {
6 let res = await fetch(
7 "https://unpkg.com/react@18/umd/react.production.min.js",
8 );

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago