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=43&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 20336 results for "function"(653ms)

FullstackStarterTopicMessage.loader.ts2 matches

@wolf•Updated 1 day ago
1import { LoaderFunctionArgs } from "https://esm.sh/react-router@7.5.0?deps=react@18.2.0,react-dom@18.2.0";
2import { getTopicById, getMessageById, getMessagesByTopicId } from "../backend/database/queries.ts";
3
4export async function loader({ params }: LoaderFunctionArgs) {
5 const topicId = parseInt(params.topicId!, 10);
6 const messageId = parseInt(params.messageId!, 10);

FullstackStarterSearchForm.tsx1 match

@wolf•Updated 1 day ago
4import { LoadingSpinner } from "./LoadingSpinner.tsx";
5
6export function SearchForm() {
7 const navigation = useNavigation();
8 const [searchParams] = useSearchParams();

FullstackStarterTopic.action.ts2 matches

@wolf•Updated 1 day ago
1import { ActionFunctionArgs } from "https://esm.sh/react-router@7.5.0?deps=react@18.2.0,react-dom@18.2.0";
2import { createMessage } from "../backend/database/queries.ts";
3
4export async function action({ request }: ActionFunctionArgs) {
5 console.log("HERE!");
6 const formData = await request.formData();

FullstackStarterSearch.tsx1 match

@wolf•Updated 1 day ago
5import { SearchForm } from "../frontend/components/SearchForm.tsx";
6
7export function Search() {
8 const { topics, messages, query } = useLoaderData() as SearchResultsType;
9 const hasResults = topics.length > 0 || messages.length > 0;

FullstackStarterMessageList.tsx1 match

@wolf•Updated 1 day ago
10}
11
12export function MessageList({ messages, topicId, highlightedMessageId }: MessageListProps) {
13 const location = useLocation();
14

FullstackStarterSearchResults.tsx1 match

@wolf•Updated 1 day ago
5import { SearchForm } from "./SearchForm.tsx";
6
7export function SearchResults() {
8 const { topics, messages, query } = useLoaderData() as SearchResultsType;
9 const hasResults = topics.length > 0 || messages.length > 0;

FullstackStarterLoadingSpinner.tsx1 match

@wolf•Updated 1 day ago
6}
7
8export function LoadingSpinner({ size = "medium" }: LoadingSpinnerProps) {
9 const sizeClasses = {
10 small: "w-4 h-4 border-2",

FullstackStarterMessageForm.tsx2 matches

@wolf•Updated 1 day ago
12}
13
14export function MessageForm({ topicId }: MessageFormProps) {
15 const navigation = useNavigation();
16 const isSubmitting = navigation.state === "submitting";
18
19 // reset the form on success
20 React.useEffect(function() {
21 if (navigation.state === "idle" && $form.current) {
22 $form.current.reset();

LiveStormMCPmcp.ts6 matches

@supagroova•Updated 1 day ago
22 * Uses a cached instance if available
23 */
24export async function setupMcpServer(): Promise<McpServer> {
25 // Return cached instance if available
26 if (mcpServerInstance) {
72 * Registers a GET endpoint as an MCP Resource
73 */
74function registerResource(
75 server: McpServer,
76 operationId: string,
162 * Registers a POST, PUT, or DELETE endpoint as an MCP Tool
163 */
164function registerTool(
165 server: McpServer,
166 operationId: string,
275 * Creates a parameter schema from an OpenAPI parameter
276 */
277function createParameterSchema(param: any): any {
278 const schema: any = {
279 type: param.schema?.type || 'string',
321
322/**
323 * Overrides the default handlePostMessage function to add the Authorization header to the request body
324 */
325export async function handlePostMessage(transport: SSETransport, context: Context): Promise<Response> {
326 try {
327 const contentType = context.req.header('content-type') || '';

LiveStormMCPindex.ts1 match

@supagroova•Updated 1 day ago
55
56/**
57 * Val.town handler function for HTTP requests
58 * This will be exposed as a Val.town HTTP endpoint
59 */

getFileEmail4 file matches

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

tuna8 file matches

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