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=674&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 8134 results for "fetch"(1610ms)

harpersmain.tsx1 match

@visnup•Updated 1 year ago
5 async function request(url) {
6 console.log(url);
7 const res = await fetch(url);
8 return load(await res.text());
9 }

fetchBlueskyPostREADME.md1 match

@vladimyr•Updated 1 year ago
1Migrated from folder: bluesky/fetchBlueskyPost

fetchTweetmain.tsx4 matches

@vladimyr•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchTweet(url) {
4 const tweetId = url.match(/(\d{19})/)[1];
5 const token = getToken(tweetId);
8 tweetURL.searchParams.set("lang", "en");
9 tweetURL.searchParams.set("token", token);
10 const res = await fetch(tweetURL, {
11 redirect: "follow",
12 });
15}
16
17// @see: https://github.com/vercel/react-tweet/blob/a292ca7/packages/react-tweet/src/api/fetch-tweet.ts#L27-L31
18function getToken(id: string) {
19 return ((Number(id) / 1e15) * Math.PI)

fetchTweetREADME.md1 match

@vladimyr•Updated 1 year ago
1Migrated from folder: a0_forks/fetchTweet

putValReproductionCasemain.tsx2 matches

@liamdanielduffy•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3await fetchJSON("https://api.val.town/v1/vals", {
4 headers: {
5 Authorization: `Bearer ${Deno.env.get("valtown")}`,

ssr_routermain.tsx1 match

@pomdtr•Updated 1 year ago
7app.all("/greet/:name", hydrate("pomdtr/example_greet_component"));
8
9export default app.fetch;

blogREADME.md1 match

@postpostscript•Updated 1 year ago
16- [2024-04-09 - reactiveStateBlob: wrap blob state in a proxy to autosave it on changes](https://val.town/v/postpostscript/reactiveStateBlob)
17- [2024-04-24 - lock: lock that releases when it leaves the execution context](https://val.town/v/postpostscript/lock)
18- [2024-04-25 - fetchWorker: communicate with a worker over a fetch-like interface](https://val.town/v/postpostscript/fetchWorker)
19- [2024-01-06 - interruptibleChain: simple interface for pausing and resuming execution chains](https://val.town/v/postpostscript/interruptibleChain) (now at https://github.com/postpostscript/chain)
20- [2024-01-07 - expiringBlob: create-and-forget blobs using UUIDv7](https://val.town/v/postpostscript/expiringBlob)

aliasmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
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 = {

ssr_react_minimain.tsx1 match

@stevekrouse•Updated 1 year ago
22 const onData = onSubmit ? onSubmit(e) : () => 1;
23 const formData = new FormData(e.target as any);
24 const resp = await fetch("/", {
25 method: props.action ?? "POST",
26 body: formData,

blobertDatamain.tsx2 matches

@rvorias•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3const gist =
5
6export const queryParams = async (req: Request) => {
7 const data = await fetch(gist);
8 const jsonData = await data.json();
9

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago