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/$2?q=function&page=2324&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 28772 results for "function"(1993ms)

webpage_summarizermain.tsx3 matches

@spinningideasUpdated 5 months ago
5import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
6
7function App() {
8 const [url, setUrl] = useState(() => {
9 // Initialize URL from localStorage on first load
214}
215
216function client() {
217 createRoot(document.getElementById("root")).render(<App />);
218}
219if (typeof document !== "undefined") { client(); }
220
221export default async function server(request: Request): Promise<Response> {
222 if (request.method === "POST" && new URL(request.url).pathname === "/summarize") {
223 try {

reflective_qamain.tsx3 matches

@spinningideasUpdated 5 months ago
10import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
11
12function App() {
13 const [notification, setNotification] = useState({ type: "success", message: "" });
14
329}
330
331function client() {
332 createRoot(document.getElementById("root")).render(<App />);
333}
334if (typeof document !== "undefined") { client(); }
335
336export default async function server(request: Request): Promise<Response> {
337 if (request.method === "POST" && new URL(request.url).pathname === "/ask") {
338 try {

cleanupmain.tsx1 match

@flymasterUpdated 5 months ago
1export default async function(interval: Interval) {
2 const ntfyChannel = Deno.env.get("CLEANUP_NTFY");
3 const cleanupFormUrl = Deno.env.get("CLEANUP_FORM");

LandscapeLightingToolmain.tsx3 matches

@chetUpdated 5 months ago
205};
206
207function App() {
208 return <LightingCalculator />;
209}
210
211function client() {
212 createRoot(document.getElementById("root")).render(<App />);
213}
215if (typeof document !== "undefined") { client(); }
216
217export default async function server(request: Request): Promise<Response> {
218 return new Response(
219 `

getShowcaseValsmain.tsx2 matches

@stevekrouseUpdated 5 months ago
49});
50
51async function getDescriptions(val) {
52 const completion = await openai.beta.chat.completions.parse({
53 model: "gpt-4o-mini",
75}, { concurrency: 3 });
76
77async function getScreenshot(url: string) {
78 const resp = await fetch(
79 "https://api.apiflash.com/v1/urltoimage?" + new URLSearchParams({

pioneeringAzurePenguinmain.tsx5 matches

@saadstoreUpdated 5 months ago
22];
23
24function VideoUploadModal({ isOpen, onClose, onUpload }) {
25 const [description, setDescription] = useState('');
26 const [file, setFile] = useState(null);
61}
62
63function VideoCard({ video }) {
64 const [likes, setLikes] = useState(video.likes);
65 const [isLiked, setIsLiked] = useState(false);
95}
96
97function App() {
98 const [videos, setVideos] = useState(mockVideos);
99 const [isUploadModalOpen, setIsUploadModalOpen] = useState(false);
136}
137
138function client() {
139 createRoot(document.getElementById("root")).render(<App />);
140}
141if (typeof document !== "undefined") { client(); }
142
143export default async function server(request: Request): Promise<Response> {
144 return new Response(`
145 <html>

widemain.tsx1 match

@maxmUpdated 5 months ago
74}
75
76export default async function(req: Request): Promise<Response> {
77 // Use your Val Town API Token to create a session
78 const wide = new Wide(await ValSession.new(Deno.env.get("valtown")));

mdxmain.tsx1 match

@pomdtrUpdated 5 months ago
26`;
27
28export function mdx(author: string, name: string) {
29 return async (req: Request) => {
30 const { readme } = await api(`/v1/alias/${author}/${name}`);

reflective_qamain.tsx3 matches

@stevekrouseUpdated 5 months ago
10import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
11
12function App() {
13 const [notification, setNotification] = useState({ type: "success", message: "" });
14
329}
330
331function client() {
332 createRoot(document.getElementById("root")).render(<App />);
333}
334if (typeof document !== "undefined") { client(); }
335
336export default async function server(request: Request): Promise<Response> {
337 if (request.method === "POST" && new URL(request.url).pathname === "/ask") {
338 try {

sprightlyCyanScorpionmain.tsx1 match

@suleiman_hamzaUpdated 5 months ago
1export default async function (request: Request): Promise<Response> {
2 const data = {
3 message: "Hello, JSON World! 🌍",

getFileEmail4 file matches

@shouserUpdated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblkUpdated 1 month ago
Simple functional CSS library for Val Town
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.