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=628&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 17350 results for "function"(1127ms)

blogBlogPost.tsx1 match

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

blog2025-04-08-migration.md2 matches

@valdottown•Updated 3 weeks 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, {

vt-blogREADME.md1 match

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

vt-blogutil.tsx2 matches

@stevekrouse•Updated 3 weeks 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", {

vt-blogSocialLinks.tsx1 match

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

vt-blogrender-markdown.ts1 match

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

vt-blogproxy.ts1 match

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

vt-blogOGImage.tsx1 match

@stevekrouse•Updated 3 weeks ago
4const LINE_HEIGHT = 72;
5
6export default function OGImage({
7 title = "Val Town Blog",
8 ...props

vt-blogLogo.tsx1 match

@stevekrouse•Updated 3 weeks ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2
3export default function (props: React.SVGProps<SVGSVGElement>) {
4 return (
5 <svg

vt-blogLogoMark.tsx2 matches

@stevekrouse•Updated 3 weeks ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2
3export default function(props: React.SVGProps<SVGSVGElement>) {
4 return (
5 <svg
18}
19
20export function Favicon(props: React.SVGProps<SVGSVGElement>) {
21 return (
22 <svg

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 week 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": "*",