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=749&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 7885 results for "fetch"(1268ms)

testSemanticsmain.tsx4 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function testSemantics({
8 api: string;
9}) {
10 const { data: last } = await fetchJSON(
11 `${api}/eval/${stateName}`
12 );
13 const now = Date.now();
14 await fetchJSON(`${api}/eval/${stateName} = ${now}`);
15 const { data: next } = await fetchJSON(
16 `${api}/eval/${stateName}`
17 );

jsonresumeExmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
2
3export const jsonresumeEx = (async () => {
4 let { render } = await import("npm:jsonresume-theme-standard-resume");
5 return render(
6 await fetchText(
7 "https://gist.githubusercontent.com/thomasdavis/c9dcfa1b37dec07fb2ee7f36d7278105/raw/b7c543a5de99d9bed90ca4fe5e506f8c0b04f77f/resume.json",
8 ),

getValIpmain.tsx2 matches

@kevinkub•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getValIp() {
4 let req = await fetch("http://whatismyip.akamai.com");
5 let ip = await req.text();
6 return ip;

getBodyFromURLmain.tsx3 matches

@maxdrake•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getBodyFromURL = async (url) => {
5 "https://deno.land/x/deno_dom/deno-dom-wasm.ts"
6 );
7 // Fetch HTML from the specified URL
8 const response = await fetch(url);
9 const html = await response.text();
10 // Parse the HTML into a new document

check_redditmain.tsx2 matches

@bnorick•Updated 1 year ago
8 if (check) {
9 check = Object.assign({
10 fetch_limit: 10,
11 force: false,
12 enable_toggle: Boolean(toggleSubreddits),
18 filters: check.filters,
19 current_state: checkRedditState,
20 fetch_limit: check.fetch_limit,
21 enable_toggle: check.enable_toggle,
22 force: check.force,

githubEventsmain.tsx2 matches

@higgins•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub events
4export let githubEvents = fetchJSON(
5 "https://api.github.com/users/stevekrouse/events"
6);

subscribeToPushmain.tsx4 matches

@devdoshi•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { handleFetchTextResponse } from "https://esm.town/v/devdoshi/handleFetchTextResponse";
3
4export let subscribeToPush = async (req: express.Request, res: express.Response) => {
11 GET: {
12 "/": async (req: express.Request, res: express.Response) => {
13 const response = await fetch(
14 `https://raw.githubusercontent.com/pirminrehm/service-worker-web-push-example/main/client${
15 req.path.substring(`/ui`.length)
16 }`,
17 ).then(handleFetchTextResponse);
18 const contentTypeMapping = {
19 "html": "text/html",

mathFactmain.tsx2 matches

@lin_junming•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export let mathFact = fetchText(
4 "http://numbersapi.com/random/math",
5);

aleister_chatleymain.tsx2 matches

@scio•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3let { aleister_chatley_countdown } = await import("https://esm.town/v/scio/aleister_chatley_countdown");
63 prompts.philip_k_dick,
64 );
65 await fetch(process.env.DISCORD_WEBHOOK_ALEISTERCHATLEY, {
66 method: "POST",
67 mode: "cors",

fetchJSONmain.tsx3 matches

@hanu•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let fetchJSON = async (url: string, options?: any) => {
4 let f = await fetch(url, {
5 ...options,
6 headers: {

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago