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=236&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 2375 results for "fetch"(391ms)

frequencyDotPlotmain.tsx1 match

@stevekrouse•Updated 1 year ago
23});
24
25export default app.fetch;

valToGHmain.tsx2 matches

@nbbaier•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=42";
3import { Octokit } from "npm:@octokit/rest";
4import { DateTime } from "npm:luxon";
127
128 try {
129 const { code } = await fetchJSON(`${API_URL}/v1/alias/${vtUser}/${valName}`, {
130 headers: { "Authorization": `Bearer ${Deno.env.get("valtown")}` },
131 });

readabilityHTTPProxymain.tsx2 matches

@nbbaier•Updated 1 year ago
1import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
3import { html } from "https://esm.town/v/stevekrouse/html?v=5";
4import { Readability } from "npm:@mozilla/readability";
89 }
90
91 let body = await fetchText(articleUrl);
92
93 let doc = new JSDOM(body);

draggableItemsmain.tsx1 match

@nbbaier•Updated 1 year ago
90});
91
92export default app.fetch;

updateValByIDmain.tsx2 matches

@nbbaier•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3interface UpdateValArgs {
20 };
21
22 return fetchJSON(`https://api.val.town/v1/vals/${valId}`, {
23 headers: {
24 Authorization: `Bearer ${token}`,

updateValByNamemain.tsx2 matches

@nbbaier•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3interface UpdateValArgs {
14 };
15
16 return fetchJSON("https://api.val.town/v1/vals", {
17 headers: {
18 Authorization: `Bearer ${token}`,

fetchPaginatedDataREADME.md3 matches

@nbbaier•Updated 1 year ago
1# Fetch Paginated Data
2
3This val exports a function that loops through paginated API responses and returns the combined data as an array. It expects pagination with `next` and there to be a `data` property in the API response. This conforms to the Val Town API, so this function is useful when fetching paginated Val Town API responses for creating custom folders in [pomdtr's vscode extension](https://github.com/pomdtr/valtown-vscode).
4
5Usage:
7```ts
8const id = <vt user id>
9await fetchPaginatedData(`https://api.val.town/v1/users/${id}/vals`, {
10 headers: { Authorization: `Bearer ${Deno.env.get("valtown")}` },
11});

hasValTownStyleGuideUpdatedmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import process from "node:process";
2import { basicAuthorization } from "https://esm.town/v/stevekrouse/basicAuthorization";
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
4
5export let hasValTownStyleGuideUpdated = async (since: Date) => {
6 let commits = await fetchJSON(
7 "https://api.github.com/repos/val-town/val.town/commits?path=/src/style.tsx&since=" +
8 since.toISOString(),

fetchPaginatedData2 file matches

@nbbaier•Updated 3 days ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago