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/$1?q=function&page=22&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 28754 results for "function"(4448ms)

utilsmain.tsx1 match

@stdUpdated 23 hours ago
2import { serveFile } from "../index.ts";
3
4export function staticHTTPServer(importMetaURL: string) {
5 const app = new Hono();
6 app.get("/", () => serveFile("/index.html", importMetaURL));

GlancerApp.tsx3 matches

@lightweightUpdated 23 hours ago
18}
19// Simple hook for mobile menu toggle
20function useMobileMenu() {
21 const [isOpen, setIsOpen] = useState(false);
22 const toggleMenu = () => setIsOpen(!isOpen);
26
27// Simple hook for tracking current hash for active nav styling
28function useCurrentHash() {
29 const [currentHash, setCurrentHash] = useState(() =>
30 window.location.hash.slice(1)
43}
44
45export function App({ initialData }: AppProps) {
46 // initialData
47 const { demoData, loading, error } = initialData;

Glancercheckout.tsx1 match

@lightweightUpdated 23 hours ago
2import { useState } from "https://esm.sh/react@18.2.0";
3
4export function CheckoutContent({ data, content }) {
5 // const { content, contentURL, docsURL } = config;
6 // console.log("content: ", content);
6});
7
8export async function getRelatedPagesFromDatabase(
9 pageId: string // the /demo page
10) {

markdownBlogStarterLayout.tsx1 match

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

markdownBlogStarterindex.tsx3 matches

@cosmopaoloUpdated 23 hours ago
5import { Layout } from "./Layout.tsx";
6
7function PostComponent({ markdown, link }: { markdown: string; link?: string }) {
8 return (
9 <div style={{ border: "1px solid gray", padding: "10px", marginBottom: "20px", borderRadius: "5px" }}>
14}
15
16export default async function(req: Request): Promise<Response> {
17 const url = new URL(req.url);
18 if (url.pathname === "/") {
44}
45
46function html(children: React.ReactNode) {
47 return new Response(
48 renderToString(
Holifant-Links

Holifant-Linksmain.tsx1 match

@tofoUpdated 23 hours ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

notesjsonblob.tsx2 matches

@cosmopaoloUpdated 23 hours ago
1import { blob } from "https://esm.town/v/std/blob";
2
3async function getRoom(roomName: string) {
4 try {
5 return await blob.getJSON(`room_${roomName}.json`);
9}
10
11async function saveRoom(roomName: string, data: any) {
12 await blob.setJSON(`room_${roomName}.json`, data);
13}

Glancerform.tsx2 matches

@lightweightUpdated 1 day ago
2import { useState } from "https://esm.sh/react@18.2.0";
3
4export function FormContent({ data, content }) {
5 // const { content, contentURL, docsURL } = config;
6 // console.log("content: ", content);
29 <h2>Cobrowse & mask fields on forms</h2>
30 <p>
31 Glance cobrowse provides a “hook” function to allow customers to
32 customize page and element masking during a cobrowse session.
33 </p>

my-first-valindex.tsx1 match

@OnujulesUpdated 1 day ago
1export default function handler(req: Request): Response {
2 const html = `<!DOCTYPE html>
3 <html lang="en">

getFileEmail4 file matches

@shouserUpdated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblkUpdated 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.