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=2304&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 33628 results for "function"(29272ms)

spellbindingFuchsiaSkinkmain.tsx2 matches

@Emailscompelling•Updated 3 months ago
35];
36
37function ToolCard({ tool }) {
38 return (
39 <div className="col-md-4">
60// Rest of the code remains the same as in the previous implementation
61
62export default async function server(request: Request) {
63 return new Response(`
64 <!DOCTYPE html>

wondrousCyanBatmain.tsx12 matches

@dcm31•Updated 3 months ago
3import React from "https://esm.sh/react@18.3.1";
4
5export default async function handler(req) {
6 // Set up HTML with SVG content that will be generated client-side
7 const html = renderToString(
102 ${html}
103 <script>
104 // Function to create a wavy path with smooth corners
105 function createCardOutline() {
106 const width = 300;
107 const height = 200;
115 }
116
117 // Function to create points along a curved rectangle with rounded corners
118 function createRoundedRectPoints(width, height, cornerRadius, numPointsPerSegment) {
119 const points = [];
120
121 // Helper function to add waviness to a point - except for connection points
122 function addWaviness(x, y, magnitude, isConnectionPoint = false) {
123 // Connection points stay exact for perfect transitions
124 if (isConnectionPoint) {
239
240 // Create a smooth path from points using bezier curves
241 function createSmoothPath(points) {
242 if (!points || points.length === 0) return '';
243
246
247 // Helper to calculate control points for smooth curves
248 function getControlPoints(p0, p1, p2, smoothness = 0.2) {
249 // Calculate distances between points
250 const d01 = Math.sqrt(Math.pow(p1.x - p0.x, 2) + Math.pow(p1.y - p0.y, 2));
295 }
296
297 // Function to render the card
298 function renderCard() {
299 const svg = document.getElementById('cardSvg');
300
326
327 // Add event listener to the button
328 document.addEventListener('DOMContentLoaded', function() {
329 renderCard();
330 document.getElementById('generateBtn').addEventListener('click', renderCard);
react-starter

react-starterApp.tsx1 match

@jxnblk•Updated 3 months ago
2import { useState } from "https://esm.sh/react@19";
3
4export default function App () {
5 const [count, setCount] = useState(0);
6
react-starter

react-starterhttp.tsx1 match

@jxnblk•Updated 3 months ago
6const CLIENT_MODULE = import.meta.url.replace("http.tsx", "client.tsx");
7
8export default async function (req: Request): Promise<Response> {
9 const app = renderToString(<App />);
10 const html = `<!DOCTYPE html>
react-streaming-starter

react-streaming-starterhttp.tsx1 match

@jxnblk•Updated 3 months ago
5const CLIENT_MODULE = import.meta.url.replace("http.tsx", "client.tsx");
6
7export default async function (req: Request): Promise<Response> {
8 const stream = await renderToReadableStream(<App />, {
9 bootstrapModules: [CLIENT_MODULE],
react-streaming-starter

react-streaming-starterApp.tsx1 match

@jxnblk•Updated 3 months ago
2import { useState } from "https://esm.sh/react@19";
3
4export default function App () {
5 const [count, setCount] = useState(0);
6
dotcom

dotcomproxies.tsx1 match

@jxnblk•Updated 3 months ago
14
15
16export default async function proxyMiddleware(req: DataRequest, res: Response, next) {
17 const match = paths.find(p => p.match(req.data.pathname));
18 if (match) {
dotcom

dotcomredirects.tsx1 match

@jxnblk•Updated 3 months ago
65];
66
67export default async function redirectMiddleware(req: DataRequest, res: Response, next): Promise<Response> {
68 const match = paths.find(p => p.match(req.data.pathname));
69 // const match = paths.find(p => p.regex.match(req.data.pathname));

fluentAmaranthChameleonmain.tsx3 matches

@Nwauto•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [messages, setMessages] = useState([]);
7 const [newMessage, setNewMessage] = useState('');
79}
80
81function client() {
82 createRoot(document.getElementById("root")).render(<App />);
83}
84if (typeof document !== "undefined") { client(); }
85
86export default async function server(request: Request): Promise<Response> {
87 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
88 const KEY = "fluentAmaranthChameleon";

skullcathttp.tsx1 match

@jxnblk•Updated 3 months ago
20// <style>body{margin:0;background-color:black;color:white;font-family:system-ui,sans-serif}</style>
21
22export default async function (req: Request): Promise<Response> {
23 return new Response(html, {
24 headers: {

discordWebhook2 file matches

@stevekrouse•Updated 6 days ago
Helper function to send Discord messages
tuna

tuna9 file matches

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