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=1041&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 13380 results for "fetch"(1214ms)

translatemain.tsx3 matches

@yieldray•Updated 7 months ago
3export async function translate(req: Request) {
4 if (req.method === "POST") {
5 const { code: status, data } = await fetch("https://deepl.deno.dev/translate", {
6 method: "POST",
7 body: req.body,
35 <script type="module">
36 import { html, Component, render } from "https://cdn.cbd.int/htm/preact/standalone.module.js";
37 import { ofetch } from "https://esm.sh/ofetch/dist/index.mjs";
38 import { z } from "https://esm.sh/zod";
39 // https://github.com/developit/htm
132 target_lang: z.string().default("zh"),
133 });
134 const data = await ofetch("/", {
135 method: "POST",
136 body: Options.parse({

cronmain.tsx4 matches

@with_heart•Updated 7 months ago
24}
25
26async function fetchAndProcessData() {
27 const response = await fetch(
28 'https://api.npmjs.org/versions/xstate/last-week',
29 )
145
146 if (await isTableEmpty()) {
147 await fetchAndProcessData()
148 }
149
157export default async function cron(interval: Interval,): Promise<void> {
158 await ensureTableExists()
159 await fetchAndProcessData()
160}
161

selfDestructmain.tsx2 matches

@codemore•Updated 7 months ago
1import ValTown from "https://esm.sh/@valtown/sdk@0.22.0";
2import { fetchValInfo } from "https://esm.town/v/pomdtr/fetchValInfo?v=2";
3
4export async function selfDestruct(importMetaUrl: string) {
5 const { id } = await fetchValInfo(importMetaUrl);
6 const { vals } = new ValTown();
7

Kinopio_Get_User_Spacesmain.tsx1 match

@pketh•Updated 7 months ago
18const getSpaces = async () => {
19 const options = requestOptions({ method: "GET" });
20 const response = await fetch(`${apiHost}/user/spaces`, options);
21 const data = await response.json();
22 const spaceNames = data.map(space => space.name);

lastloginmain.tsx1 match

@olifrah•Updated 7 months ago
10 useEffect(() => {
11 const checkAuth = async () => {
12 const response = await fetch('/auth/check');
13 const data = await response.json();
14 setEmail(data.email);

strivingSilverTapirmain.tsx2 matches

@dcm31•Updated 7 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const telegramGetMe = async (botToken: string) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/getMe`,
6 );

telegramGetMemain.tsx2 matches

@dcm31•Updated 7 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const telegramGetMe = async (botToken: string) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/getMe`,
6 );

switchbot_partymain.tsx2 matches

@stevekrouse•Updated 7 months ago
76 .toString("base64");
77
78 const response = await fetch(`https://api.switch-bot.com/${path}`, {
79 headers: {
80 "Authorization": token,
244});
245
246export default app.fetch;

selfDestructmain.tsx2 matches

@peterqliu•Updated 7 months ago
1import ValTown from "https://esm.sh/@valtown/sdk@0.22.0";
2import { fetchValInfo } from "https://esm.town/v/pomdtr/fetchValInfo?v=2";
3
4export async function selfDestruct(importMetaUrl: string) {
5 const { id } = await fetchValInfo(importMetaUrl);
6 const { vals } = new ValTown();
7

fetchValInfomain.tsx1 match

@pomdtr•Updated 7 months ago
2import ValTown from "npm:@valtown/sdk";
3
4export function fetchValInfo(importMetaURL: string) {
5 const vt = new ValTown();
6 const { author, name } = extractValInfo(importMetaURL);

GithubPRFetcher

@andybak•Updated 1 day ago

proxiedfetch1 file match

@jayden•Updated 2 days ago