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=45&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 29307 results for "function"(4133ms)

TownMessages.tsx9 matches

@loading•Updated 1 day ago
23});
24
25export function Messages ({
26 messages,
27 messageEndTimes,
58}
59
60function Message ({
61 message,
62 messageEndTimes,
86}
87
88function AssistantMessage ({ message, messageEndTimes, running }: {
89 message: Message;
90 messageEndTimes: Record<string, number>;
107}
108
109function Part ({ part }) {
110 switch (part.type) {
111 case "text":
122}
123
124function TextPart ({ part }) {
125 return (
126 <ReactMarkdown>
130}
131
132function Details ({ open, onClick, children, summary }) {
133 return (
134 <details
148}
149
150function ToolPart ({ part }) {
151 const { openSummaries, setOpenSummaries } = useContext(MessageContext);
152 const {
312}
313
314function EditorToolPart ({ part }) {
315 const { openSummaries, setOpenSummaries } = useContext(MessageContext);
316 const {
379}
380
381function UserMessage ({ message }: {
382 message: Message;
383}) {

Townlogin.tsx1 match

@loading•Updated 1 day ago
11
12// server-side route for /login page
13function LoginRoute() {
14 return (
15 <html lang="en-us">

TownLoading.tsx1 match

@loading•Updated 1 day ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2
3export function Loading () {
4 return (
5 <div className="muted">

Townlayout.ts3 matches

@loading•Updated 1 day ago
10}
11
12export function renderLayout(content: string, options: LayoutOptions): string {
13 const { title, activeTab = "dashboard", scripts = [], styles = [] } = options;
14
149 // Default scripts
150 const defaultScripts = `
151 document.addEventListener('DOMContentLoaded', function() {
152 // Tab navigation
153 document.querySelectorAll('.tab').forEach(tab => {
154 tab.addEventListener('click', function(e) {
155 if (this.getAttribute('href') === '#') {
156 e.preventDefault();

TownLayoutRoute.tsx1 match

@loading•Updated 1 day ago
3import { Header } from "./Header.tsx";
4
5export function LayoutRoute() {
6 return (
7 <>

TownInputBox.tsx6 matches

@loading•Updated 1 day ago
4import { processFiles } from "../utils/images.ts";
5
6export function InputBox ({
7 value,
8 onChange,
88}
89
90export function ImageDropContainer ({
91 images,
92 setImages,
115}
116
117export function useImageDrop ({ images, setImages, running }: {
118 images: (string|null)[];
119 setImages(images: (string|null)[]) => void;
164}
165
166function ImageRow ({ images, setImages }: {
167 images: (string|null)[];
168 setImages: (images: (string|null)[]) => void;
186}
187
188function Thumbnail ({ image, onRemove }: {
189 image: string|null;
190 onRemove: () => void;
211}
212
213function UploadButton ({
214 images,
215 setImages,

TownInlinePreview.tsx2 matches

@loading•Updated 1 day ago
4import { MessageContext } from "./Messages.tsx";
5
6export function InlinePreview ({ part }) {
7 const project = useContext(ProjectContext);
8 const message = useContext(MessageContext);
73const SCREENSHOT_URL = "https://screenshots.valtown.net/screenshot.png";
74
75function getScreenshotURL ({
76 version,
77 endpoint,

Towninference-calls.ts1 match

@loading•Updated 1 day ago
29}
30
31export function renderInferenceCalls(
32 data: InferenceCallRow[],
33 pagination: PaginationData,

Towninference-calls.ts1 match

@loading•Updated 1 day ago
6 * Get paginated inference calls
7 */
8export async function getInferenceCalls(url: URL) {
9 const { page, pageSize } = getPaginationParams(url);
10 const usageId = url.searchParams.get("usage_id");

Townindex.ts1 match

@loading•Updated 1 day ago
11 * Main entry point for the usage dashboard
12 */
13export default async function(req: Request) {
14 // Check authentication first
15 const authResponse = await basicAuthMiddleware(req);
tuna

tuna9 file matches

@jxnblk•Updated 1 day ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month 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.