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=function&page=1074&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 17289 results for "function"(1501ms)

neatChocolateLynxmain.tsx9 matches

@vesty91•Updated 3 months ago
6import { BrowserRouter as Router, Route, Routes, Link } from "https://esm.sh/react-router-dom@6.11.2?deps=react@18.2.0,react-dom@18.2.0";
7
8function Navigation() {
9 return (
10 <Navbar bg="dark" variant="dark" expand="lg" className="mb-4 gaming-navbar">
25}
26
27function HomePage() {
28 const testimonials = [
29 { name: "Alex G.", text: "Service exceptionnel ! Mon PC gaming fonctionne mieux que jamais." },
96}
97
98function ServicesPage() {
99 return (
100 <Container className="my-5">
133}
134
135function AboutPage() {
136 return (
137 <Container className="my-5">
151}
152
153function ContactPage() {
154 const [formData, setFormData] = useState({
155 name: "",
202}
203
204function Footer() {
205 return (
206 <footer className="bg-dark text-light py-4 mt-5">
237}
238
239function App() {
240 return (
241 <Router>
252}
253
254function client() {
255 createRoot(document.getElementById("root")).render(<App />);
256}
260}
261
262export default async function server(request: Request): Promise<Response> {
263 return new Response(`
264 <!DOCTYPE html>

scholarlyRedWhalemain.tsx9 matches

@vesty91•Updated 3 months ago
6import { BrowserRouter as Router, Route, Routes, Link } from "https://esm.sh/react-router-dom@6.11.2?deps=react@18.2.0,react-dom@18.2.0";
7
8function Navigation() {
9 return (
10 <Navbar bg="dark" variant="dark" expand="lg" className="mb-4 gaming-navbar">
25}
26
27function HomePage() {
28 const testimonials = [
29 { name: "Alex G.", text: "Service exceptionnel ! Mon PC gaming fonctionne mieux que jamais." },
96}
97
98function ServicesPage() {
99 return (
100 <Container className="my-5">
133}
134
135function AboutPage() {
136 return (
137 <Container className="my-5">
151}
152
153function ContactPage() {
154 const [formData, setFormData] = useState({
155 name: "",
202}
203
204function Footer() {
205 return (
206 <footer className="bg-dark text-light py-4 mt-5">
237}
238
239function App() {
240 return (
241 <Router>
252}
253
254function client() {
255 createRoot(document.getElementById("root")).render(<App />);
256}
260}
261
262export default async function server(request: Request): Promise<Response> {
263 return new Response(`
264 <!DOCTYPE html>

p5main.tsx3 matches

@moe•Updated 3 months ago
1import { frameHtml } from "https://esm.town/v/moe/frameHtmlRaw";
2
3export function sketch(module: string, title = "P5 Sketch") {
4 return async function(req: Request): Promise<Response> {
5 // console.log("module:", module)
6 const url = new URL(req.url);
87}
88
89function r() {
90 return Math.floor(Math.random() * 100);
91}

countryOutlineSVGmain.tsx3 matches

@andybak•Updated 3 months ago
1export default async function server(request: Request): Promise<Response> {
2 // Pre-import external modules to avoid async import inside function
3 const topojson = await import("https://esm.sh/topojson-client");
4 const path = await import("https://esm.sh/d3-geo");
41
42 // Generate SVG from country boundaries
43 async function generateSVG(geojsonFeatures) {
44 // Create a feature collection to use for projection
45 const featureCollection = {

unicodeToSVGmain.tsx1 match

@andybak•Updated 3 months ago
1export default async function server(request: Request): Promise<Response> {
2 // Extract character from URL path
3 const url = new URL(request.url);

nearsparkmain.tsx2 matches

@andybak•Updated 3 months ago
1import { Image } from "https://deno.land/x/imagescript@1.2.15/mod.ts";
2
3function encodeURL(url: string): string {
4 return btoa(encodeURIComponent(url));
5}
6
7export default async function handler(req: Request): Promise<Response> {
8 const url = new URL(req.url);
9 const params = url.searchParams;

upmain.tsx1 match

@todepond•Updated 3 months ago
1import { blob } from "https://esm.town/v/std/blob";
2
3export default async function(req: Request): Promise<Response> {
4 const name = ((req.url.split("?")[1] ?? "").split("=")[0] ?? "").split("/")[0];
5

removeBackgroundPhotomain.tsx3 matches

@roysarajit143•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function BackgroundRemover() {
6 const [image, setImage] = useState<string | null>(null);
7 const [processedImage, setProcessedImage] = useState<string | null>(null);
126}
127
128function client() {
129 createRoot(document.getElementById("root")).render(<BackgroundRemover />);
130}
131if (typeof document !== "undefined") { client(); }
132
133export default async function server(request: Request): Promise<Response> {
134 return new Response(`
135 <html>

weatherAppmain.tsx3 matches

@yasinarfaht•Updated 3 months ago
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function WeatherApp() {
6 const [weather, setWeather] = useState(null);
7 const [location, setLocation] = useState({ latitude: null, longitude: null });
152};
153
154function client() {
155 createRoot(document.getElementById("root")).render(<WeatherApp />);
156}
157if (typeof document !== "undefined") { client(); }
158
159export default async function server(request: Request): Promise<Response> {
160 return new Response(
161 `

ios_AppStoreFetchermain.tsx4 matches

@arfan•Updated 3 months ago
325
326/* ---------------------------------- HTML ---------------------------------- */
327function getHtml() {
328 return `
329<!DOCTYPE html>
344
345/* ------------------------------ SERVER LOGIC ------------------------------ */
346export default async function server(request: Request): Promise<Response> {
347 const url = new URL(request.url);
348 const { blob } = await import("https://esm.town/v/std/blob");
444
445/* ------------------------------ CLIENT LOGIC ------------------------------ */
446function App() {
447 const config = {
448 fetchEndpoint: "/fetch-app-info",
898}
899
900function client() {
901 createRoot(document.getElementById("root")).render(<App />);
902}

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",