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/$%7BsvgDataUrl%7D?q=function&page=74&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 31568 results for "function"(3972ms)

dynamiciframemain.ts1 match

@suterana•Updated 4 days ago
12 <title>Iframe Content</title>
13 <script>
14 function updateParentHeight() {
15 //const height = document.documentElement.scrollHeight;
16 const height = document.documentElement.getBoundingClientRect().height;

pdmain.tsx3 matches

@maxm•Updated 4 days ago
72type PagerDutyWebhook = z.infer<typeof PagerDutyWebhookSchema>;
73
74// Helper function to format Discord message
75function formatDiscordMessage(webhook: PagerDutyWebhook): string {
76 const { event } = webhook;
77 const { data } = event;
85}
86
87async function getBody(req: Request) {
88 try {
89 return await req.json();

untitled-3613main.tsx1 match

@EmpireResourcesCo•Updated 4 days ago
1export default async function() {
2 return { message: "Hello from Val Town!" };
3}

safwqindex.tsx1 match

@wqkdqw•Updated 4 days ago
52
53// ✅ esm.town requires this to be the export
54export default async function handler(req: Request): Promise<Response> {
55 const html = renderToString(<RedirectHTML />);
56 return new Response("<!DOCTYPE html>\n" + html, {

safwqLayout.tsx1 match

@wqkdqw•Updated 4 days ago
2import type { ReactNode } from "npm:react@18.2.0";
3
4export function Layout({ children }: { children: ReactNode }) {
5 return (
6 <html lang="en">

adventofcode2015solutions.ts1 match

@gueejla•Updated 4 days ago
1export function day1() {
2 return "hello world";
3}

adventofcode2015main.tsx10 matches

@gueejla•Updated 4 days ago
8}
9
10function DateGrid({ selectedDate, onDateSelect }: DateGridProps) {
11 // Generate dates 1-25 for Advent of Code
12 const dates = Array.from({ length: 25 }, (_, i) => i + 1);
46}
47
48function VerifyAttempted({ isVerified, onVerificationChange }: VerifyAttemptedProps) {
49 const [inputValue, setInputValue] = useState("");
50
93}
94
95function ViewSolution({ selectedDay }: ViewSolutionProps) {
96 const [solutionCode, setSolutionCode] = useState<string>("");
97 const [loading, setLoading] = useState(true);
109 const solutionsContent = await response.text();
110
111 // Extract the specific day's function
112 const functionName = `day${selectedDay}`;
113 const functionRegex = new RegExp(`function ${functionName}\\(\\)[^{]*{[^}]*}`, "s");
114 const match = solutionsContent.match(functionRegex);
115
116 if (match) {
141}
142
143function App() {
144 const [selectedDate, setSelectedDate] = useState<number | null>(null);
145 const [isVerified, setIsVerified] = useState(false);
177}
178
179function client() {
180 createRoot(document.getElementById("root")).render(<App />);
181}
185}
186
187function server(req: Request): Promise<Response> {
188 return new Response(
189 `

datastar-denomain.tsx1 match

@eduwass•Updated 4 days ago
1import { ServerSentEventGenerator } from "npm:datastar-sdk/web";
2
3export default async function(req: Request) {
4 const url = new URL(req.url);
5

ciphermain.tsx3 matches

@bao•Updated 4 days ago
5import { quoteCount } from "./constants.ts";
6
7function client() {
8 const root = document.getElementById("root");
9 if (root) {
14if (typeof document !== "undefined") { client(); }
15
16export default async function server(request: Request): Promise<Response> {
17 const requestPath = new URL(request.url).pathname;
18 if (requestPath === "/quote") {
52 <script>
53 window.dataLayer = window.dataLayer || [];
54 function gtag(){dataLayer.push(arguments);}
55 gtag('js', new Date());
56 gtag('config', 'G-JFTLXQP7TR');

tuempresaarequipe_uploadBlobProxy.tsx1 match

@arequipe•Updated 4 days ago
1import { blob } from "https://esm.town/v/std/blob";
2
3export async function uploadBlobProxy(req: Request): Promise<Response> {
4 // Asegurarse de que la solicitud sea un POST
5 if (req.method !== "POST") {
tuna

tuna9 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 2 months ago
A helper function to build a file's email
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.