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=743&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 8415 results for "fetch"(1530ms)

getJSONmain.tsx2 matches

@yuler•Updated 1 year ago
1import { fetchWithJSON } from "https://esm.town/v/yuler/fetchWithJSON";
2
3export let getJSON = <T = any>(url: string): Promise<T> => {
4 console.log(url);
5 return fetchWithJSON(url);
6};

FigmaAvatarsMixerTestmain.tsx2 matches

@rodrigotello•Updated 1 year ago
1import { fetchFigmaFile } from "https://esm.town/v/rodrigotello/fetchFigmaFile";
2import { parseFigmaURL } from "https://esm.town/v/rodrigotello/parseFigmaURL";
3import process from "node:process";
9 "https://www.figma.com/file/XqiternEMTE2Gk8jHzG4Ui/AvatarMixerFileTest?type=design&node-id=0%3A1&mode=design&t=Mpjs48FGMgw77SXW-1",
10 ).key;
11 return fetchFigmaFile(apiToken, fileKey);
12})();

hnTopStorymain.tsx3 matches

@fab1an•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function hnTopStory() {
4 const topStories: Number[] = await fetch(
5 "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
6 ).then((res) => res.json());
13 score: number;
14 by: string;
15 } = await fetch(`https://hacker-news.firebaseio.com/v0/item/${id}.json`).then(
16 (res) => res.json()
17 );

slackReplyToMessagemain.tsx2 matches

@vtdocs•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2import process from "node:process";
3
18 // Note: `req.body.event` has information about the event
19 // like the sender and the message text
20 const result = await fetchJSON(
21 "https://slack.com/api/chat.postMessage",
22 {

valVersionsmain.tsx2 matches

@neverstew•Updated 1 year ago
1import { searchParams } from "https://esm.town/v/stevekrouse/searchParams?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export function valVersions({ token, id, offset, limit }: {
25 }
26 : {};
27 return fetchJSON(
28 `https://api.val.town/v1/vals/${id}/versions?` +
29 searchParams({

renderGithubReadmemain.tsx3 matches

@pomdtr•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function renderGithubReadme(req: express.Request, res: express.Response) {
6 repo: string;
7 };
8 const markdown = await fetch(`https://api.github.com/repos/${repo}/readme`)
9 .then((res) => res.json()).then(({ content }) => atob(content));
10 const html = await fetch("https://api.github.com/markdown", {
11 method: "POST",
12 headers: {

viewMailboxmain.tsx1 match

@nimalu•Updated 1 year ago
24 li.innerHTML = '<span class="font-semibold text-gray-900">Web</span>: ' + message;
25 ul.appendChild(li)
26 fetch("https://api.val.town/eval/@nimalu.messageMe('" + message + "','Web')")
27 }
28

YoutubeTranscriptmain.tsx1 match

@park•Updated 1 year ago
1export let YoutubeTranscript = async (videoId) => {
2 const { YoutubeTranscript } = await import("npm:youtube-transcript");
3 return YoutubeTranscript.fetchTranscript(videoId);
4};

fetchFilemain.tsx3 matches

@Llad•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const fetchFile = async (url: string, options?: any) => {
4 const fileUrl =
5 "https://www.gcmgrosvenor.com/wp-content/uploads/Private-Credit-Co-investing-GCM-Grosvenor.pdf";
6 const blob = await fetch(fileUrl).then((r) => r.blob());
7 return blob;
8};

EmailNotifIfDidntCodemain.tsx2 matches

@Davidkim•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export async function EmailNotifIfDidntCode() {
14 org?: any;
15 }
16 const githubEvents = await fetchJSON(
17 "https://api.github.com/users/daviddkkim/events",
18 ) as Data;

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago