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=261&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 2746 results for "fetch"(618ms)

infoboxCrawlermain.tsx1 match

@stevekrouse•Updated 7 months ago
26 visited.add(url);
27
28 const response = await fetch(url);
29 const html = await response.text();
30 const $ = cheerio.load(html);

pushmain.tsx2 matches

@stevekrouse•Updated 8 months ago
1/** @jsxImportSource npm:hono@3/jsx */
2import { modifyFetchHandler as codeOnValTownBanner } from "https://esm.town/v/andreterron/codeOnValTown";
3import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth";
4import { Hono } from "npm:hono@3";
122
123export default codeOnValTownBanner(
124 passwordAuth(app.fetch, { verifyPassword: verifyToken }),
125);

requestCollectormain.tsx1 match

@maxm•Updated 8 months ago
128 }
129
130 // Fetch recent requests
131 const requests = await sqlite.execute(`
132 SELECT id, method, url, timestamp

postmanClonemain.tsx3 matches

@maxm•Updated 8 months ago
1/**
2 * This val creates a Postman-like interface for testing HTTP requests directly in the browser.
3 * It uses React for the UI and the Fetch API to make requests.
4 * The server function serves the HTML and handles the API requests.
5 */
24 body: method !== 'GET' && body ? body : undefined
25 };
26 const res = await fetch('/proxy', {
27 method: 'POST',
28 headers: { 'Content-Type': 'application/json' },
108 const { url: targetUrl, options } = await request.json();
109 try {
110 const response = await fetch(targetUrl, options);
111 const data = await response.json();
112 return new Response(JSON.stringify({

niceTodoListmain.tsx1 match

@maxm•Updated 8 months ago
43 }
44
45 // Fetch todos from the database
46 const todos = await sqlite.execute(`SELECT * FROM ${KEY}_todos_${SCHEMA_VERSION} ORDER BY id DESC`);
47

test_migratedmain.tsx1 match

@jxnblk•Updated 8 months ago
76 if (valURL) {
77 try {
78 await fetch(valURL)
79 .then(res => res.json())
80 .then(res => {

hnmain.tsx1 match

@maxm•Updated 8 months ago
135
136 // Proceed with the proxy request
137 let resp = await fetch("https://news.ycombinator.com" + url.pathname + url.search, {
138 headers: req.headers,
139 method: req.method,

emailmain.tsx1 match

@shouser•Updated 8 months ago
68 headers?: Record<string, string>;
69}) => {
70 let result = await fetch(
71 `${API_URL}/v1/email`,
72 {

sqlitemain.tsx2 matches

@maxm•Updated 8 months ago
35
36async function execute(statement: InStatement): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
49
50async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
51 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
52 method: "POST",
53 headers: {

phpServemain.tsx1 match

@maxm•Updated 8 months ago
83 const form = event.target;
84 const formData = new FormData(form);
85 const response = await fetch('/api', {
86 method: 'POST',
87 headers: {

fetchPaginatedData2 file matches

@nbbaier•Updated 6 days ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago