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/?q=fetch&page=663&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 8056 results for "fetch"(828ms)

oldstyleUtilmain.tsx2 matches

@easrng•Updated 1 year ago
34}
35export async function set(path: string, value: any) {
36 let resolveResp = await fetch(
37 `${API_URL}/v1/alias/${path}`,
38 {
47 }
48 const { id } = await resolveResp.json();
49 let resp = await fetch(
50 `${API_URL}/v1/vals/${id}/versions`,
51 {

fetchJSON_examplemain.tsx4 matches

@vladimyr•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch?v=4";
2import { fetchJSON } from "https://esm.town/v/vladimyr/fetchJSON";
3
4console.log(await fetchJSON("https://pie.dev/get"));
5console.log(await fetchJSON("https://pie.dev/get", { fetch }));

fetchJSON_exampleREADME.md1 match

@vladimyr•Updated 1 year ago
1Migrated from folder: a2_shared/fetchJSON_example

valshotmain.tsx3 matches

@vladimyr•Updated 1 year ago
1// SPDX-License-Identifier: 0BSD
2import { fetchVal } from "https://esm.town/v/vladimyr/fetchVal";
3import { serveReadme } from "https://esm.town/v/vladimyr/serveReadme";
4import { toHonoHandler } from "https://esm.town/v/vladimyr/toHonoHandler";
11 const { author, name } = c.req.param();
12 const query = c.req.query();
13 const { code } = await fetchVal(author, name);
14 const imageURL = await createScreenshot(code, query.theme);
15 return c.redirect(imageURL.href);
16});
17
18export default router.fetch;
19
20export async function createScreenshot(code: string, theme: string = "dark-plus"): Promise<URL> {

jsr2ghmain.tsx3 matches

@vladimyr•Updated 1 year ago
18 const scope = c.req.param("scope").slice(1);
19 const name = c.req.param("name");
20 const { githubRepository: repo } = await fetchPackageData(scope, name);
21 if (repo) {
22 const githubURL = new URL(`https://github.com/${repo.owner}/${repo.name}`);
27});
28
29export default app.fetch;
30
31export async function fetchPackageData(scope: string, name: string) {
32 const prefixUrl = "https://api.jsr.io/";
33 const data = await ky.get(`scopes/${scope}/packages/${name}`, { prefixUrl }).json();

libaspmain.tsx1 match

@vladimyr•Updated 1 year ago
53}
54
55export function fetchASP(id: string, server = "keyoxide.org") {
56 const url = new URL(`https://keyoxide.org/.well-known/aspe/id/${id}`);
57 url.hostname = server;

authIdUserGuidemain.tsx1 match

@postpostscript•Updated 1 year ago
64});
65
66export default app.fetch;

oldstyleREADME.md2 matches

@easrng•Updated 1 year ago
8export default async () => {
9 // import vals
10 const fetchFns = [@std.fetch, @easrng.moduleFetch];
11 console.log(
12 await Promise.all(
13 fetchFns.map((fn) =>
14 fn("https://icanhazip.com").then((res) => res.text()),
15 ),

tanHedgehogmain.tsx1 match

@greatcode•Updated 1 year ago
21});
22
23export default app.fetch;

test_explorer_uimain.tsx1 match

@pomdtr•Updated 1 year ago
103 tests[testID].status = "running";
104 setTests({ ...tests });
105 const resp = await fetch("/api/run", {
106 method: "POST",
107 body: JSON.stringify({

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago