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/$%7Bsuccess?q=function&page=8&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 18129 results for "function"(1067ms)

TowniePreview.tsx1 match

@std•Updated 3 hours ago
10}
11
12export function Preview({ projectFiles, messages, running }: PreviewProps) {
13 const [selectedEndpointIndex, setSelectedEndpointIndex] = useState<number>(0);
14 const [customPath, setCustomPath] = useState<string>("/");

TowniePreviewFrame.tsx4 matches

@std•Updated 3 hours ago
9}
10
11export function PreviewFrame (props: PreviewProps) {
12 const previewKey = useRef<string>("new-chat");
13 const [count, setCount] = useState<number>(0);
77const TSRE = /\/$/;
78
79function URLInput ({ url, pathname, setPathname }) {
80 const prefix = url.replace(TSRE, "");
81 return (
94}
95
96function PreviewSelect ({ index, setIndex, files }) {
97 return (
98 <div>
120}
121
122function usePreviewURL ({ files }) {
123 const [index, setIndex] = useState<number>(0);
124 const htmlVals = files?.filter(file => file.links?.endpoint !== undefined);

TownieNotFoundRoute.tsx1 match

@std•Updated 3 hours ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2
3export function NotFoundRoute () {
4 return (
5 <div className="container">Page not found</div>

TownieNewProjectRoute.tsx2 matches

@std•Updated 3 hours ago
4import { useCreateProject } from "../hooks/useCreateProject.tsx";
5
6export function NewProjectRoute () {
7 const [name, setName] = useState("");
8 const [privacy, setPrivacy] = useState("public");
65]
66
67function PrivacyRadios ({
68 value,
69 onChange,

TownieMessages.tsx8 matches

@std•Updated 3 hours ago
14};
15
16export function Messages ({
17 messages,
18 messageEndTimes,
40}
41
42function Message ({
43 message,
44 messageEndTimes,
60}
61
62function AssistantMessage ({ message, messageEndTimes, running }: {
63 message: Message;
64 messageEndTimes: Record<string, number>;
85}
86
87function Part ({ part }) {
88 switch (part.type) {
89 case "text":
100}
101
102function TextPart ({ part }) {
103 return (
104 <ReactMarkdown>
108}
109
110function ToolPart ({ part }) {
111 const {
112 toolName,
154}
155
156function EditorToolPart ({ part }) {
157 const {
158 toolName,
220}
221
222function UserMessage ({ message }: {
223 message: Message;
224}) {

TownieLoginRoute.tsx1 match

@std•Updated 3 hours ago
4import { useAuth } from "../hooks/useAuth.tsx";
5
6export function LoginRoute () {
7 const navigate = useNavigate();
8 const { isAuthenticated, authenticate, error } = useAuth();

TownieLoading.tsx1 match

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

TownieLayoutRoute.tsx1 match

@std•Updated 3 hours ago
3import { Header } from "./Header.tsx";
4
5export function LayoutRoute () {
6 // TODO fetch here because we're not doing any caching
7 // and we want the user data in the header ?

TownieInputBox.tsx6 matches

@std•Updated 3 hours 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,

Townieicons.tsx16 matches

@std•Updated 3 hours ago
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2
3export function TownieIcon({
4 size = 24,
5 color = "currentColor",
50}
51
52export function Circle ({
53 filled,
54}: {
74}
75
76export function Square ({
77 size = 24,
78}: {
98
99// icons from https://lucide.dev
100export function SquarePenIcon () {
101 return (
102 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-square-pen-icon lucide-square-pen"><path d="M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"/></svg>
104}
105
106export function FileCode2Icon () {
107 return (
108 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-file-code2-icon lucide-file-code-2"><path d="M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="m5 12-3 3 3 3"/><path d="m9 18 3-3-3-3"/></svg>
110}
111
112export function SparklesIcon () {
113 return (
114 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-sparkles-icon lucide-sparkles"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/><path d="M20 3v4"/><path d="M22 5h-4"/><path d="M4 17v2"/><path d="M5 18H3"/></svg>
116}
117
118export function EyeIcon () {
119 return (
120 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-eye-icon lucide-eye"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/></svg>
122}
123
124export function ExternalLinkIcon () {
125 return (
126 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-external-link-icon lucide-external-link"><path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/></svg>
128}
129
130export function KeyRoundIcon () {
131 return (
132 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-key-round-icon lucide-key-round"><path d="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"/><circle cx="16.5" cy="7.5" r=".5" fill="currentColor"/></svg>
134}
135
136export function LockKeyholeIcon () {
137 return (
138 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-lock-keyhole-icon lucide-lock-keyhole"><circle cx="12" cy="16" r="1"/><rect x="3" y="10" width="18" height="12" rx="2"/><path d="M7 10V7a5 5 0 0 1 10 0v3"/></svg>
140}
141
142export function PlusIcon () {
143 return (
144 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-plus-icon lucide-plus"><path d="M5 12h14"/><path d="M12 5v14"/></svg>
146}
147
148export function ArrowUpIcon () {
149 return (
150 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-arrow-up-icon lucide-arrow-up"><path d="m5 12 7-7 7 7"/><path d="M12 19V5"/></svg>
152}
153
154export function RefreshIcon ({ size = 24 }: { size: number }) {
155 return (
156 <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-rotate-cw-icon lucide-rotate-cw"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/></svg>
158}
159
160export function XIcon ({ size = 24 }: {
161 size?: number;
162}) {
166}
167
168export function VolumeOffIcon ({ size = 24 }) {
169 return (
170 <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-volume-off-icon lucide-volume-off"><path d="M16 9a5 5 0 0 1 .95 2.293"/><path d="M19.364 5.636a9 9 0 0 1 1.889 9.96"/><path d="m2 2 20 20"/><path d="m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11"/><path d="M9.828 4.172A.686.686 0 0 1 11 4.657v.686"/></svg>
172}
173
174export function Volume2Icon ({ size = 24 }) {
175 return (
176 <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-volume2-icon lucide-volume-2"><path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"/><path d="M16 9a5 5 0 0 1 0 6"/><path d="M19.364 18.364a9 9 0 0 0 0-12.728"/></svg>

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",