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/$%7Burl%7D?q=function&page=25&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 19140 results for "function"(1037ms)

blog-cloneFooter.tsx1 match

@jamiesinclair•Updated 2 days ago
5const year = new Date().getFullYear();
6
7export default function Footer () {
8 return (
9 <footer className="container">

blog-cloneEXAMPLE.md1 match

@jamiesinclair•Updated 2 days ago
21
22```typescript
23function hello() {
24 console.log("Hello, Val Town!");
25}

blog-cloneByline.tsx1 match

@jamiesinclair•Updated 2 days ago
2import { formatDate, dayOfWeek } from "./util.tsx";
3
4export default function Byline ({ post }: {
5 post: {
6 author: string;

blog-cloneBlogPost.tsx1 match

@jamiesinclair•Updated 2 days ago
10}
11
12export function BlogPostComponent({ post, content }: BlogPostProps) {
13 return (
14 <Layout title={post.title}>

blog-clone2025-04-08-migration.md2 matches

@jamiesinclair•Updated 2 days ago
83We didn't. We left them where they are, and proxy to them.
84
85Writing a proxy in Val Town (or any functions platform with the ['fetch handler' interface](https://blog.val.town/blog/the-api-we-forgot-to-name/)) is a delight:
86
87```ts
88const OLD_BLOG_HOST = "https://val-town-blog.pages.dev/";
89export async function proxy(req: Request): Promise<Response> {
90 const url = new URL(req.url);
91 return fetch(OLD_BLOG_HOST + url.pathname + url.search, {

blogutil.tsx2 matches

@jamiesinclair•Updated 2 days ago
1export function formatDate(dateString: string): string {
2 try {
3 const date = new Date(dateString);
12}
13
14export function dayOfWeek(dateString: string): string {
15 try {
16 return new Date(dateString).toLocaleDateString("en-US", {

blogSocialLinks.tsx1 match

@jamiesinclair•Updated 2 days ago
2import { BlueskyIcon, DiscordIcon, GitHubIcon, RSSIcon, TwitterIcon } from "./icons.tsx";
3
4export default function SocialLinks() {
5 return (
6 <div className="social-links">

blogrender-markdown.ts1 match

@jamiesinclair•Updated 2 days ago
10
11// Process markdown content
12export async function processMarkdown(content: string): Promise<string> {
13 const result = await unified()
14 .use(remarkParse)

blogREADME.md1 match

@jamiesinclair•Updated 2 days ago
31 - **`rss.ts`**: RSS feed generation
32 - **`favicon.ts`** & **`og-image.ts`**: Asset routes
33- **`/utils/`**: Utility functions for post processing, caching, etc.
34- **`/posts/`**: Markdown files for blog posts
35- **`/styles/`**: CSS styling

blogproxy.ts1 match

@jamiesinclair•Updated 2 days ago
5const OLD_BLOG_URL = "https://val-town-blog.pages.dev/";
6
7export async function proxyHonoRequest(c: any) {
8 const url = new URL(c.req.url);
9

getFileEmail4 file matches

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