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=638&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 7881 results for "fetch"(1590ms)

evalPost1main.tsx2 matches

@pomdtr•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3console.log(
4 await fetchJSON(
5 "https://api.val.town/v1/eval",
6 {

ntfyReqmain.tsx1 match

@arrudaricardo•Updated 1 year ago
152
153export async function sendNotification(baseURL: string, body: NtfyJSONBody): Promise<Response> {
154 return await fetch(baseURL, {
155 method: "POST",
156 body: JSON.stringify(body),

vtTypesmain.tsx1 match

@easrng•Updated 1 year ago
82 return new Response(
83 `/// <reference no-default-lib="true"/>\n`
84 + ((await Promise.all(urls.map(url => fetch(url).then(res => res.text())))).join("\n\n").replace(
85 /^\/\/\/.+/gm,
86 "",

gltf_torusmain.tsx1 match

@vladimyr•Updated 1 year ago
228});
229
230export default app.fetch;

json_viewerREADME.md2 matches

@vladimyr•Updated 1 year ago
8
9```ts
10import { fetch } from "https://esm.town/v/std/fetch";
11import { json_viewer } from "https://esm.town/v/stevekrouse/json_viewer";
12
13export const weatherDescription = async (params: string[]): Promise<unknown> => {
14 let data = await fetch(`https://wttr.in/${params["city"]}?format=j1`);
15 let jsonData = await data.json();
16 return json_viewer(jsonData);

playgroundmain.tsx3 matches

@easrng•Updated 1 year ago
718 if (load) {
719 try {
720 code = await (await fetch(new URL(load, "https://esm.town/v/"))).text();
721 } catch (e) {
722 code = `/*\nFailed to load '${load}': ${e}\n*/`;
754 );
755 } else {
756 const res = await fetch(API_URL + "/v1/eval", {
757 method: "POST",
758 body: JSON.stringify({
801 }
802});
803export default app.fetch;
804type Log = {
805 type: string;

newRSSItemsmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchRSS } from "https://esm.town/v/stevekrouse/fetchRSS";
2
3export let newRSSItems = ({ url, lastRunAt }) =>
4 fetchRSS(url)
5 .then(({ channel: { item } }) =>
6 (Array.isArray(item) ? item : [item]).filter(

newRSSItemsmain.tsx2 matches

@andrewn•Updated 1 year ago
1import { fetchRSS } from "https://esm.town/v/stevekrouse/fetchRSS";
2
3export let newRSSItems = ({ url, lastRunAt }) =>
4 fetchRSS(url)
5 .then(({ channel: { item } }) =>
6 (Array.isArray(item) ? item : [item]).filter(

umbrellaRemindermain.tsx2 matches

@mojombo•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import { nominatimSearch } from "https://esm.town/v/stevekrouse/nominatimSearch";
4import { weatherGovGrid } from "https://esm.town/v/stevekrouse/weatherGovGrid";
14 lon,
15 });
16 let { properties: { periods } } = await fetchJSON(
17 grid.forecastHourly,
18 );

viewSourcemain.tsx2 matches

@reecer•Updated 1 year ago
1import { prettifyHtml } from "https://esm.town/v/neverstew/prettifyHtml";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
3import { escape } from "npm:html-sloppy-escaper";
4
5export default async function viewSource(req: Request) {
6 const pathname = new URL(req.url).pathname;
7 const html = await fetchText(pathname === "/" ? "example.com" : pathname); // .then(prettifyHtml);
8 const body = `<html>
9 <head>

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago