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/$%7Bart_info.art.src%7D?q=fetch&page=1273&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 13464 results for "fetch"(1204ms)

finalUrlmain.tsx2 matches

@neverstew•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function finalUrl(req: Request) {
4 const url = new URL(req.url).pathname.replace(/^\//, "");
5 const response = await fetch(url);
6 return new Response("", {
7 headers: {

aliasmain.tsx2 matches

@neverstew•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function alias<P extends Params>(params: P): Promise<Result<P>> {
9 if ("valName" in params && params.token)
10 headers.Authorization = `Bearer ${params.token}`;
11 return fetchJSON(url, { headers });
12}
13type UserParams = {

valToStringmain.tsx2 matches

@pomdtr•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function valToString(val: string) {
6 }
7 const [author, name] = val.split(".");
8 const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`);
9 if (resp.status !== 200) {
10 throw new Error(resp.statusText);

todosPlaceholdermain.tsx2 matches

@pomdtr•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const todosPlaceholder = (async () => {
4 const resp = await fetch("https://jsonplaceholder.typicode.com/todos");
5 return resp.json();
6})();

chatmain.tsx1 match

@nimalu•Updated 1 year ago
24 document.getElementById("message-input").value = '';
25 const ul = document.getElementById("inbox");
26 const data = await fetch("https://api.val.town/eval/@nimalu.sendChatMessage('" + message + "','"+ sender + "')")
27 .then(res => res.json())
28 .then(res => res.data)

testPostCallmain.tsx2 matches

@mehmet•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function testPostCall() {
4 const result = await fetchJSON(
5 "https://api.val.town/express/@stevekrouse.postWebhook1",
6 {

pageApimain.tsx2 matches

@mgruel•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/mgruel/fetchJSON";
2
3type PaginatedData<T> = {
22 nextUrl.searchParams.set("limit", `${limit}`);
23 while (nextUrl) {
24 const { data, links } = await fetchJSON<PaginatedData<T>>(
25 nextUrl,
26 options,

holidaysUSmain.tsx2 matches

@jaeseung272crb•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Public holidays in the US in 2023
4export let holidaysUS = fetchJSON(
5 "https://date.nager.at/api/v2/publicholidays/2023/US"
6);

pingHttpmain.tsx2 matches

@robin•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function pingHttp(url: string) {
4 try {
5 const res = await fetch(url);
6 return res.status === 200;
7 } catch {

starWarsmain.tsx2 matches

@insanity54•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);

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 3 days ago