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=48&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 30868 results for "function"(3127ms)

val-town-http-mcp-servercliTools.ts1 match

@nbbaier•Updated 2 days ago
8import {getErrorMessage} from "../lib/errorUtils.ts";
9
10export function registerCliTools(server: McpServer, _config: Config) {
11 // Watch files in a project for real-time updates
12 server.tool(

val-town-http-mcp-serverCLAUDE.md3 matches

@nbbaier•Updated 2 days ago
8
9## Style Guidelines
10- Use TypeScript strict mode with explicit typing for function parameters/returns
11- 2-space indentation, semicolons at line ends
12- Use camelCase for variables/functions, PascalCase for types/interfaces, UPPER_SNAKE_CASE for constants
13- Tool names use kebab-case (e.g., `get-val`)
14- Document all public functions with JSDoc
15- Wrap async operations in try/catch blocks and use getErrorMessage utility
16- Return consistent error responses with isError flag

val-town-http-mcp-serverbranchTools.ts1 match

@nbbaier•Updated 2 days ago
6import {z} from "npm:zod"
7
8export function registerBranchTools(server: McpServer, config: Config) {
9 // List all branches in a val
10 server.tool(

val-town-http-mcp-serverblobTools.ts1 match

@nbbaier•Updated 2 days ago
5import {getErrorMessage} from "../lib/errorUtils.ts"
6
7export function registerBlobTools(server: McpServer, config: Config) {
8 // List blobs
9 server.tool(

val-town-http-mcp-serverapi.ts1 match

@nbbaier•Updated 2 days ago
1import {Config} from "./types.ts"
2
3export async function callValTownApi(
4 config: Config,
5 path: string,

twilioWebhookmain.tsx1 match

@Dentalabcs•Updated 2 days ago
1import { generateResponses } from "@Dentalabcs/generateResponses";
2
3export async function twilioWebhook(req: Request) {
4 console.log("Webhook received:", req.method);
5

sqliteExplorerAppREADME.md1 match

@arfan•Updated 2 days ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
37

tanstackReactHonoExamplerouter.tsx1 match

@neverstew•Updated 2 days ago
66
67// Export the RouterProvider component with QueryClient
68export function RouterApp() {
69 return (
70 <QueryClientProvider client={queryClient}>

tanstackReactHonoExampleREADME.md1 match

@neverstew•Updated 2 days ago
65### Query
66```tsx
67export function usePostMessage() {
68 return useMutation({
69 mutationFn: (content: string) => postMessage(content),

tanstackReactHonoExampleREADME.md2 matches

@neverstew•Updated 2 days ago
16In a normal server environment, you would likely use a middleware [like this one](https://hono.dev/docs/getting-started/nodejs#serve-static-files) to serve static files. Some frameworks or deployment platforms automatically make any content inside a `public/` folder public.
17
18However in Val Town you need to handle this yourself, and it can be suprisingly difficult to read and serve files in a Val Town Project. This template uses helper functions from [stevekrouse/utils/serve-public](https://www.val.town/x/stevekrouse/utils/branch/main/code/serve-public/README.md), which handle reading project files in a way that will work across branches and forks, automatically transpiles typescript to javascript, and assigns content-types based on the file's extension.
19
20### `index.html`
26## CRUD API Routes
27
28This app has two CRUD API routes: for reading and inserting into the messages table. They both speak JSON, which is standard. They import their functions from `/backend/database/queries.ts`. These routes are called from the React app to refresh and update data.
29
30## Errors
tuna

tuna9 file matches

@jxnblk•Updated 1 week 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.