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/image-url.jpg%20%22Optional%20title%22?q=function&page=70&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 19937 results for "function"(1341ms)

aaaApp.tsx1 match

@vawogbemi•Updated 2 days ago
17import reactLogo from "./assets/react.svg";
18
19function App() {
20 const [count, setCount] = useState(0);
21

TESTmain.tsx3 matches

@vawogbemi•Updated 2 days ago
5import About from "https://esm.town/v/vawogbemi/whoIsHiringAbout";
6
7function App() {
8 const tabs = { "/": "Home", "/about": "About" };
9 const [activeTab, setActiveTab] = useState("/");
339}
340
341function ServerApp() {
342 return (
343 <html>
362}
363
364export default async function(req: Request): Promise<Response> {
365 const url = new URL(req.url);
366 if (url.pathname === "/api/stories") {

aaaserver.tsx2 matches

@vawogbemi•Updated 2 days ago
1import { parseProject } from "https://esm.town/v/std/utils@71-main/index.ts";
2
3function getContentType(filepath: string): string {
4 // If no extension or empty path, default to text/html
5 if (filepath === "" || filepath === "/" || !filepath.includes(".")) {
27
28const projectVal = parseProject(import.meta.url);
29export default async function(req: Request): Promise<Response> {
30 const url = new URL(req.url);
31 const path = `/${projectVal.username}/${projectVal.name}@${projectVal.version}${url.pathname}`;

aaaREADME.md1 match

@vawogbemi•Updated 2 days ago
11```ts
12const projectVal = parseProject(import.meta.url);
13export default async function(req: Request): Promise<Response> {
14 const url = new URL(req.url);
15 const path = `/${projectVal.username}/${projectVal.name}@${projectVal.version}${url.pathname}`;

sssserver.tsx2 matches

@vawogbemi•Updated 2 days ago
1import { parseProject } from "https://esm.town/v/std/utils@71-main/index.ts";
2
3function getContentType(filepath: string): string {
4 // If no extension or empty path, default to text/html
5 if (filepath === "" || filepath === "/" || !filepath.includes(".")) {
27
28const projectVal = parseProject(import.meta.url);
29export default async function(req: Request): Promise<Response> {
30 const url = new URL(req.url);
31 const path = `/${projectVal.username}/${projectVal.name}@${projectVal.version}${url.pathname}`;

sssApp.tsx1 match

@vawogbemi•Updated 2 days ago
17import reactLogo from "./assets/react.svg";
18
19function App() {
20 const [count, setCount] = useState(0);
21

untitled-2887new-file-5904.tsx3 matches

@Gj64•Updated 2 days ago
3
4// Main Calendar App Component
5export default function CalendarApp() {
6 // State management
7 const [currentDate, setCurrentDate] = useState(new Date());
38 });
39
40 // Date navigation functions
41 const goToNextPeriod = () => {
42 const newDate = new Date(currentDate);
81 };
82
83 // Helper function to get month and year display
84 const getHeaderDisplay = () => {
85 if (view === "month") {

Afolabis2main.tsx7 matches

@vawogbemi•Updated 2 days ago
42import { renderToString } from "react-dom/server";
43
44function SideDrawer({ trigger, title, content, initialOpen = false }: {
45 trigger: React.JSX.Element;
46 title: string;
74}
75
76function BottomDrawer({ trigger, title, content, initialOpen = false }: {
77 trigger: React.JSX.Element;
78 title: string;
279};
280
281function ProductCard(
282 { db, cart, product, activeProductId, setActiveProductId }: {
283 db: any;
439}
440
441function ProductCarousel({ children }: { children: React.ReactNode }) {
442 const [emblaRef, emblaApi] = useEmblaCarousel({
443 axis: "x",
470 const scrollResult = emblaApi.scrollTo(emblaApi.selectedScrollSnap() + Math.sign(delta));
471
472 if (scrollResult && typeof scrollResult.then === "function") {
473 scrollResult.then(() => {
474 isScrollingRef.current = false;
1092
1093// Client-side rendering
1094function client() {
1095 const root = document.getElementById("root");
1096 if (root) {
1111const app = new Hono();
1112
1113// Server-side rendering function
1114const renderPage = () => {
1115 const content = renderToString(

denoViteApp.tsx1 match

@vawogbemi•Updated 2 days ago
17import reactLogo from "./assets/react.svg";
18
19function App() {
20 const [count, setCount] = useState(0);
21

testPondiverseuser1 match

@argmn•Updated 2 days ago
1export default async function(req: Request): Promise<Response> {
2 const form = await req.json();
3 const { user, password } = form;

getFileEmail4 file matches

@shouser•Updated 3 weeks ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 3 weeks 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.