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/$%7Burl%7D?q=fetch&page=870&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 14112 results for "fetch"(11371ms)

hn_notifierindex.ts1 match

@charmaine•Updated 2 months ago
31});
32
33export default app.fetch;

hn_notifierfetchClient.ts2 matches

@charmaine•Updated 2 months ago
1import { createFetch } from "https://esm.sh/@better-fetch/fetch";
2
3export const $api = createFetch({
4 baseURL: "/api",
5});

vsmarketplaceRSSmain.tsx1 match

@ewired•Updated 2 months ago
215 });
216
217 const response = await fetch(qp.json);
218 const jsonData = await response.json();
219
ditherPng

ditherPngmain.tsx2 matches

@maxm•Updated 2 months ago
11
12async function getImage(url: string) {
13 const data = await fetch(url).then((e) => e.arrayBuffer()).then((e) => new Uint8Array(e));
14 const image = await loadImage(data);
15
28 || "https://64.media.tumblr.com/890467167af5755e783852b43862c5f8/464de28a7bab42a9-2e/s500x750/746aaed1ae2e6b35b28b29643e7a4f84ca5fe8c5.png";
29 if (url.pathname === "/original.png") {
30 return fetch(
31 imgUrl,
32 );

monkepixels.ts1 match

@maxm•Updated 2 months ago
26
27async function getImageFromWeb(path: string) {
28 const res = await fetch(path);
29 if (res.ok) {
30 const data = new Uint8Array(await res.arrayBuffer());

ditheringMaybeindex.ts2 matches

@maxm•Updated 2 months ago
21});
22
23// HTTP vals expect an exported "fetch handler"
24// This is how you "run the server" in Val Town with Hono
25export default app.fetch;

OpenTownieuseProjectFiles.ts4 matches

@maxm•Updated 2 months ago
1import { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
2import { fetchProjectFiles } from "../utils/api.ts";
3
4interface UseProjectFilesProps {
15
16/**
17 * Custom hook to fetch and manage project files
18 */
19export function useProjectFiles({
38
39 try {
40 const filesData = await fetchProjectFiles({
41 bearerToken,
42 projectId,
51 }
52 } catch (err) {
53 console.error("Error fetching project files:", err);
54 setProjectFiles([]);
55 setError(err instanceof Error ? err : new Error(String(err)));

OpenTowniesystem_prompt.txt5 matches

@maxm•Updated 2 months ago
71```
72
735. **fetchTranspiledJavaScript** - Fetch and transpile TypeScript to JavaScript:
74```ts
75const jsCode = await fetchTranspiledJavaScript("https://esm.town/v/username/project/path/to/file.ts");
76```
77
200
201 // Inject data to avoid extra round-trips
202 const initialData = await fetchInitialData();
203 const dataScript = `<script>
204 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
258
2595. **API Design:**
260 - `fetch` handler is the entry point for HTTP vals
261 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
262 - Properly handle CORS if needed for external access

OpenTownieProjects.tsx1 match

@maxm•Updated 2 months ago
10
11async function loader({ bearerToken }: { bearerToken: string }) {
12 const data = await (await fetch("/api/projects-loader", {
13 headers: {
14 "Authorization": "Bearer " + bearerToken,

OpenTownieindex.ts1 match

@maxm•Updated 2 months ago
28});
29
30export default app.fetch;

FetchBasic2 file matches

@ther•Updated 1 week ago

GithubPRFetcher

@andybak•Updated 1 week ago