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=434&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 8361 results for "fetch"(2630ms)

dailySlackRoundupmain.tsx1 match

@charmaine•Updated 3 months ago
1export const dailySlackRoundup = async () => {
2 const res = await fetch(process.env.BRAINBOT_WEBHOOK_URL, {
3 method: "POST",
4 body: JSON.stringify({

admirableTomatoLimpetmain.tsx1 match

@Its_nasim_ch•Updated 3 months ago
33
34 try {
35 const response = await fetch("/book", {
36 method: "POST",
37 headers: { "Content-Type": "application/json" },

glowingTextmain.tsx3 matches

@Bella_s•Updated 3 months ago
58
59 useEffect(() => {
60 async function fetchWritings() {
61 try {
62 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
69 setWritings(result.rows);
70 } catch (error) {
71 console.error("Error fetching writings:", error);
72 }
73 }
74
75 fetchWritings();
76 }, []);
77

isMyWebsiteDownmain.tsx2 matches

@charmaine•Updated 3 months ago
14 start = performance.now();
15 try {
16 const res = await fetch(url);
17 end = performance.now();
18 status = res.status;
25 } catch (e) {
26 end = performance.now();
27 reason = `couldn't fetch: ${e}`;
28 ok = false;
29 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

resourcefulAquaKoalamain.tsx1 match

@Sushantkc•Updated 3 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

cerebras_codermain.tsx1 match

@prit•Updated 3 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

cerebras_codermain.tsx1 match

@santhosh960•Updated 3 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

blissfulVioletLemurmain.tsx10 matches

@shivdwipgo•Updated 3 months ago
12
13 useEffect(() => {
14 fetchFiles();
15 }, [currentPath]);
16
17 const fetchFiles = async () => {
18 try {
19 const response = await fetch(`/list-files?path=${encodeURIComponent(currentPath)}`);
20 const fileList = await response.json();
21 setFiles(fileList.sort((a, b) => {
26 }));
27 } catch (error) {
28 console.error('Error fetching files:', error);
29 }
30 };
34
35 try {
36 const response = await fetch('/create-folder', {
37 method: 'POST',
38 headers: { 'Content-Type': 'application/json' },
44
45 if (response.ok) {
46 fetchFiles();
47 setNewFileName('');
48 }
61
62 try {
63 const response = await fetch('/upload-file', {
64 method: 'POST',
65 body: formData
67
68 if (response.ok) {
69 fetchFiles();
70 }
71 } catch (error) {
89 const deleteItem = async (itemName, isFolder) => {
90 try {
91 const response = await fetch('/delete-item', {
92 method: 'POST',
93 headers: { 'Content-Type': 'application/json' },
100
101 if (response.ok) {
102 fetchFiles();
103 setSelectedFiles([]);
104 }

fileManagerAppmain.tsx10 matches

@shivdwipgo•Updated 3 months ago
12
13 useEffect(() => {
14 fetchFiles();
15 }, [currentPath]);
16
17 const fetchFiles = async () => {
18 try {
19 const response = await fetch(`/list-files?path=${encodeURIComponent(currentPath)}`);
20 const fileList = await response.json();
21 setFiles(fileList.sort((a, b) => {
26 }));
27 } catch (error) {
28 console.error('Error fetching files:', error);
29 }
30 };
34
35 try {
36 const response = await fetch('/create-folder', {
37 method: 'POST',
38 headers: { 'Content-Type': 'application/json' },
44
45 if (response.ok) {
46 fetchFiles();
47 setNewFileName('');
48 }
61
62 try {
63 const response = await fetch('/upload-file', {
64 method: 'POST',
65 body: formData
67
68 if (response.ok) {
69 fetchFiles();
70 }
71 } catch (error) {
89 const deleteItem = async (itemName, isFolder) => {
90 try {
91 const response = await fetch('/delete-item', {
92 method: 'POST',
93 headers: { 'Content-Type': 'application/json' },
100
101 if (response.ok) {
102 fetchFiles();
103 setSelectedFiles([]);
104 }

cerebras_codermain.tsx1 match

@Sushantkc•Updated 3 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago