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=195&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 2749 results for "fetch"(497ms)

svgEditorsystem_prompt.txt5 matches

@dcm31•Updated 1 month 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

openTownieMadeThis1index.ts2 matches

@charmaine•Updated 1 month ago
1import { Hono } from "https://esm.sh/hono@3.12.6";
2import { readFile, serveFile } from "https://esm.town/v/std/utils@71-main/index.ts";
3import { reloadOnSaveFetchMiddleware, currentProjectRef } from "https://esm.town/v/charmaine/reloadOnSaveProject/reloadOnSaveProject.ts";
4
5const app = new Hono();
52
53// This is the entry point for HTTP vals
54export default reloadOnSaveFetchMiddleware(app.fetch);

forkyindex.ts2 matches

@smh•Updated 1 month ago
232});
233
234// HTTP vals expect an exported "fetch handler"
235// This is how you "run the server" in Val Town with Hono
236export default app.fetch;

forkyApp.tsx1 match

@smh•Updated 1 month ago
25 }
26
27 const response = await fetch(`/fork?url=${encodeURIComponent(projectUrl)}`, {
28 method: "POST",
29 headers: {

nextgentrees.ts1 match

@maxm•Updated 1 month ago
4// import duckdb from "npm:duckdb";
5export async function ddb() {
6 const resp = await fetch(
7 "https://raw.githubusercontent.com/maxmcd/t/refs/heads/main/trees-24.csv",
8 );

cerebras_coderindex1 match

@webrixo•Updated 1 month ago
5async function servePublicFile(path: string): Promise<Response> {
6 const url = new URL("./public/" + path, import.meta.url);
7 const text = await (await fetch(url, {
8 headers: {
9 "User-Agent": "", // to transpile TS to JS

cerebras_coderindex1 match

@webrixo•Updated 1 month ago
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({

OpenTownieNormalsystem_prompt.txt5 matches

@dcm31•Updated 1 month 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

OpenTownieNormalProjects.tsx1 match

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

OpenTownieNormalindex.ts1 match

@dcm31•Updated 1 month ago
28});
29
30export default app.fetch;

fetchPaginatedData2 file matches

@nbbaier•Updated 6 days ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago