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/$1?q=fetch&page=3&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 10806 results for "fetch"(926ms)

tourguidesw.js4 matches

@neverstew•Updated 6 hours ago
42});
43
44// Fetch event - serve from cache when offline
45self.addEventListener('fetch', event => {
46 const { request } = event;
47 const url = new URL(request.url);
50 if (url.pathname.startsWith('/api/')) {
51 event.respondWith(
52 fetch(request)
53 .then(response => {
54 // Cache successful API responses
93 }
94
95 return fetch(request)
96 .then(response => {
97 // Cache successful responses

tourguideitinerary.ts6 matches

@neverstew•Updated 6 hours ago
136 });
137 } catch (error) {
138 console.error('Error fetching itinerary:', error);
139 return c.json<ApiResponse<null>>({
140 success: false,
141 error: 'Failed to fetch itinerary'
142 }, 500);
143 }
152 });
153 } catch (error) {
154 console.error('Error fetching itineraries:', error);
155 return c.json<ApiResponse<null>>({
156 success: false,
157 error: 'Failed to fetch itineraries'
158 }, 500);
159 }
213 });
214 } catch (error) {
215 console.error('Error fetching progress:', error);
216 return c.json<ApiResponse<null>>({
217 success: false,
218 error: 'Failed to fetch progress'
219 }, 500);
220 }

charmaineValSearchimport.ts3 matches

@charmaine•Updated 6 hours ago
29 if (userId && !processedUsers.has(userId)) {
30 try {
31 // Fetch user data
32 const user = await vt.users.retrieve(userId);
33
45 processedUsers.add(userId);
46 } catch (error) {
47 console.error(`Error fetching user ${userId}:`, error);
48 // Continue with project processing even if user fetch fails
49 }
50 }

charmaineValSearchdb.ts1 match

@charmaine•Updated 6 hours ago
884 const searchPattern = `%${searchText}%`;
885
886 // 3. Start all data fetching queries in parallel, regardless of result type
887 // This way we don't wait for counts to finish before starting data queries
888 const fileResultsPromise = withTiming(async () => {

charmaineValSearchcomponents.tsx2 matches

@charmaine•Updated 6 hours ago
1221 <h3>Try searching for:</h3>
1222 <div className="search-examples">
1223 <a href="?q=fetch" className="example-link">fetch</a>
1224 <a href="?q=api" className="example-link">api</a>
1225 <a href="?q=database" className="example-link">database</a>
1375 <h3>Try searching for:</h3>
1376 <div className="search-examples">
1377 <a href="?q=fetch" className="example-link">fetch</a>
1378 <a href="?q=api" className="example-link">api</a>
1379 <a href="?q=database" className="example-link">database</a>

charmaineValSearchclient.tsx7 matches

@charmaine•Updated 6 hours ago
6 let lastSearchTerm = '';
7 let debounceTimer;
8 let currentRequest = null; // To track the current fetch request
9 let requestCounter = 0; // To identify requests
10 let currentResults = [];
11 let selectedIndex = -1;
12
13 // Function to fetch typeahead results
14 async function fetchTypeahead(query) {
15 if (query.length < 1) {
16 hideResults();
32
33 try {
34 const response = await fetch(\`/typeahead?q=\${encodeURIComponent(query)}\`, { signal });
35 if (!response.ok) throw new Error('Network response was not ok');
36
51 // Ignore abort errors which happen when we cancel the request
52 if (error.name !== 'AbortError') {
53 console.error('Typeahead fetch error:', error);
54 }
55 } finally {
120 // If it's a new query (just one character), search immediately
121 if (query.length === 1) {
122 fetchTypeahead(query);
123 } else {
124 // Otherwise use debounce for better performance during typing
125 debounceTimer = setTimeout(() => {
126 fetchTypeahead(query);
127 }, 200); // Debounce delay
128 }

TownieREADME.md1 match

@valdottown•Updated 7 hours ago
8
9- **AI-Assisted Editing**: Chat with Claude 4 Sonnet about your code and let it make changes directly to your project files
10- **Fetch tool**: Townie is able to make HTTP calls to your HTTP services to test them and continue iterating
11- **Branch Management**: View, select, and create branches without leaving the app
12- **Sound Notifications**: Get alerted when Claude finishes responding
102 try {
103 // Get open issues from GitHub
104 const openIssues = await fetchOpenIssues();
105
106 // Use LLM to find semantically related issues
188
189/**
190 * Fetch all open issues from GitHub repository using Octokit
191 */
192async function fetchOpenIssues(): Promise<any[]> {
193 const githubToken = Deno.env.get("GITHUB_TOKEN");
194 const githubRepo = Deno.env.get("GITHUB_REPO");
215 const perPage = 100;
216
217 // Fetch all open issues using Octokit
218 while (true) {
219 const response = await octokit.rest.issues.listForRepo({
239 return allIssues;
240 } catch (error) {
241 console.error("Error fetching issues with Octokit:", error);
242 return [];
243 }

reactHonoStarterindex.ts2 matches

@lightweight•Updated 8 hours 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;

untitled-4654main.tsx2 matches

@dhanush_tnva•Updated 8 hours ago
32 // Chat Completions (POST /v1/chat/completions)
33 try {
34 const response: any = await fetch("https://api.sarvam.ai/v1/chat/completions", {
35 method: "POST",
36 headers: {
73});
74
75export default app.fetch;

HN-fetch-call2 file matches

@ImGqb•Updated 9 hours ago
fetch HackerNews by API

FRAMERFetchBasic1 file match

@bresnik•Updated 1 day ago