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=1406&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 24792 results for "function"(4629ms)

treasureGeneratormain.tsx2 matches

@dcm31•Updated 1 month ago
675};
676
677function client() {
678 createRoot(document.getElementById("root")).render(<QuestTreasureGenerator />);
679}
683}
684
685export default async function server(request: Request): Promise<Response> {
686 const html = `
687 <!DOCTYPE html>

FarcasterGalleryformat.ts1 match

@onchaindom•Updated 1 month ago
1export function formatJSON(json: any) {
2 return JSON.stringify(json, null, 2);
3}

FarcasterGalleryFarcasterMiniApp.tsx1 match

@onchaindom•Updated 1 month ago
5import { MonoButtonWithStatus, Section } from "./ui.tsx";
6
7export function FarcasterMiniApp() {
8 const [context, setContext] = useState<any>();
9 const [walletAddresses, setWalletAddresses] = useState<any>();

FarcasterGalleryExample.tsx1 match

@onchaindom•Updated 1 month ago
2import { useState } from "https://esm.sh/react@19";
3
4export function Example() {
5 return (
6 <div class="m-5 mb-8">

logoWorkshopOpenMojiSvgHostClient.tsx3 matches

@dcm31•Updated 1 month ago
3
4/**
5 * Client utility functions to interact with svgHost service
6 */
7
8// Function to validate SVG content
9export const validateSvg = (content: string): boolean => {
10 return (
15};
16
17// Function to upload SVG content to svgHost
18export const uploadSvgToHost = async (svgContent: string, name: string): Promise<{success: boolean, id?: string, url?: string, error?: string}> => {
19 try {

hono_html_AppsApp.tsx5 matches

@arfan•Updated 1 month ago
35
36\`\`\`javascript
37function greet(name) {
38 console.log(\`Hello, \${name}!\`);
39}
173 const SectionTitle = ({ title }: { title: string }) => <h2 className="text-2xl font-semibold mb-4">{title}</h2>;
174
175 // Helper function to create toast notifications
176 const showToast = (message: string, type: 'info' | 'success' | 'error' = 'success') => {
177 const toastContainer = document.getElementById('toast-container');
831 * Initializes the app in the browser
832 *******************************************/
833function client() {
834 createRoot(document.getElementById("root")).render(<ThemeDemo />);
835}
840 * Handles initial page load and HTML setup
841 *******************************************/
842export default async function server(request: Request): Promise<Response> {
843 return new Response(
844 `
854 <script>
855 // Set theme from localStorage on page load
856 (function() {
857 const savedTheme = localStorage.getItem('theme');
858 if (savedTheme) {

hono_html_AppsApp.tsx3 matches

@arfan•Updated 1 month ago
139};
140
141function App() {
142 const [selectedCategories, setSelectedCategories] = useState<string[]>([]);
143 const [, setUpdateTrigger] = useState({});
237}
238
239function client() {
240 createRoot(document.getElementById("root")).render(<App />);
241}
242if (typeof document !== "undefined") { client(); }
243
244export default async function server(request: Request): Promise<Response> {
245 const html = `
246 <!DOCTYPE html>

hono_html_Appsserver3 matches

@arfan•Updated 1 month ago
7const app = new Hono();
8
9// Helper function to read files relative to the current module
10const readAsset = (path: string) => readFile(path, import.meta.url);
11
57 // Import the App.tsx module to execute it
58 const module = await import("./hm_links/App.tsx");
59 // Call the default export function (server) with the request
60 return await module.default(c.req.raw);
61 } catch (error) {
70 // Import the theme-demo App.tsx module to execute it
71 const module = await import("./theme-demo/App.tsx");
72 // Call the default export function (server) with the request
73 return await module.default(c.req.raw);
74 } catch (error) {

MiniAppStarterFarcasterMiniApp.tsx1 match

@andrewcarneal•Updated 1 month ago
4import { formatAddress, formatJSON, MonoButtonWithStatus, Section } from "./ui.tsx";
5
6export function FarcasterMiniApp() {
7 const [context, setContext] = useState<any>();
8 const [walletAddresses, setWalletAddresses] = useState<any>();

OpenTownieuseProjectFiles.ts1 match

@neverstew•Updated 1 month ago
17 * Custom hook to fetch and manage project files
18 */
19export function useProjectFiles({
20 projectId,
21 branchId,

getFileEmail4 file matches

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

tuna8 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.