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=687&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 8288 results for "fetch"(1091ms)

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({

valshotmain.tsx3 matches

@pomdtr•Updated 1 year ago
17 const query = c.req.query();
18
19 const code = await fetchValCode(`${params.author}/${params.name}`);
20 const imageURL = await createScreenshot(code, query.theme);
21 return Response.redirect(imageURL);
22});
23
24export default router.fetch;
25
26export async function createScreenshot(code: string, theme: string = "dark-plus"): Promise<URL> {
35}
36
37async function fetchValCode(alias: string): Promise<string> {
38 const prefixUrl = "https://api.val.town/v1/alias";
39 const { code } = await ky.get(alias, { prefixUrl }).json();

authDescribeScopesmain.tsx1 match

@postpostscript•Updated 1 year ago
23 return [scope, html`${value}`];
24 } catch (e) {
25 console.log("could not fetch scope", scope, e);
26 }
27 })).then(res => Object.fromEntries(res.filter(Boolean)));

test_explorermain.tsx1 match

@pomdtr•Updated 1 year ago
3export { Test } from "https://esm.town/v/pomdtr/test";
4
5export default router.fetch;

honoExamplemain.tsx1 match

@bis•Updated 1 year ago
12}
13
14export default app.fetch;

metamain.tsx2 matches

@postpostscript•Updated 1 year ago
11 const name = getValNameFromUrl(url).slice(1);
12
13 const res = await fetch(`https://api.val.town/v1/alias/${name}`, {
14 headers: {
15 authorization: `Bearer ${Deno.env.get("valtown")}`,
39 }
40
41 return fetch(url).then((res) => res.text()).then(text => {
42 moduleSourceCache.set(url, text);
43 return text;

search_liked_valsmain.tsx1 match

@pomdtr•Updated 1 year ago
4export default async function(ctx: BrowserContext<{ user: string }>) {
5 const { user: userID } = ctx.params;
6 const resp = await fetch(`https://api.val.town/v1/me/likes?limit=100`, {
7 headers: {
8 Authorization: `Bearer ${Deno.env.get("valtown")}`,

recommendsmain.tsx1 match

@postpostscript•Updated 1 year ago
2
3export async function randomLike() {
4 const { data } = await fetch("https://api.val.town/v1/me/likes", {
5 headers: {
6 Authorization: `Bearer ${Deno.env.get("valtown")}`,

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago