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=637&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 17292 results for "function"(700ms)

vt_blogvt-blog.md1 match

@shouser•Updated 3 weeks ago
62```ts
63// Example of how we fetch blog posts
64async function getAllBlogPosts() {
65 // Get local posts from markdown files
66 const localPosts = await getLocalBlogPosts();

vt_blogrender-markdown.ts1 match

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

vt_blogproxy.ts1 match

@shouser•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_blogLayout.tsx1 match

@shouser•Updated 3 weeks ago
7}
8
9export function Layout({ title, children }: LayoutProps) {
10 return (
11 <html lang="en">

vt_blogHomePage.tsx2 matches

@shouser•Updated 3 weeks ago
4import { Layout } from "./Layout.tsx";
5
6function formatDate(dateString: string): string {
7 try {
8 const date = new Date(dateString);
16}
17
18export function HomePage({ posts }: { posts: BlogPost[] }) {
19 return (
20 <Layout title="Val Town Blog">

vt_blogget-posts.ts1 match

@shouser•Updated 3 weeks ago
4
5// Get all blog posts (local + RSS)
6export async function getAllBlogPosts(): Promise<BlogPost[]> {
7 return (await Promise.all([
8 getNewPosts(),

vt_blogget-old-posts.ts1 match

@shouser•Updated 3 weeks ago
4const OLD_BLOG_RSS = "https://val-town-blog.pages.dev/rss.xml";
5// Get blog posts from RSS feed
6export async function getOldPosts(): Promise<BlogPost[]> {
7 const parser = new RssParser();
8 const feed = await parser.parseURL(OLD_BLOG_RSS);

vt_blogget-new-posts.ts2 matches

@shouser•Updated 3 weeks ago
4
5// Get all blog posts from the file system
6export async function getNewPosts(): Promise<BlogPost[]> {
7 const files = await listFiles(import.meta.url);
8 const blogPostFiles = files.filter(
38
39// Get a single blog post by slug
40export async function getBlogPostBySlug(slug: string): Promise<BlogPost | null> {
41 const content = await readFile(`/posts/${slug}.md`, import.meta.url);
42 const { data, content: markdownContent } = matter(content);

vt_blogEXAMPLE.md1 match

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

vt_blogBlogPost.tsx2 matches

@shouser•Updated 3 weeks ago
9}
10
11function formatDate(dateString: string): string {
12 try {
13 const date = new Date(dateString);
22}
23
24export function BlogPostComponent({ post, content }: BlogPostProps) {
25 return (
26 <Layout title={`${post.title} - Val Town Blog`}>

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": "*",