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/$%7Bsuccess?q=function&page=16&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 18175 results for "function"(1151ms)

test-blogblog.ts3 matches

@charmaine•Updated 18 hours ago
4
5// Parse front matter from markdown content
6function parseFrontMatter(content: string): { metadata: BlogPostMetadata; content: string } {
7 const frontMatterRegex = /^---\n([\s\S]*?)\n---\n([\s\S]*)$/;
8 const match = content.match(frontMatterRegex);
33
34// Get all blog posts
35export async function getBlogPosts(): Promise<BlogPost[]> {
36 try {
37 const files = await listFiles(import.meta.url);
72
73// Get a specific blog post by slug
74export async function getBlogPost(slug: string): Promise<BlogPost | null> {
75 try {
76 const filePath = `/posts/${slug}.md`;

testPondiverseadmin.tsx1 match

@argmn•Updated 18 hours ago
1export function isAdmin(password: string | null): boolean {
2 if (password) return password == Deno.env.get("PONDIVERSE_STORE_ADMIN_PASSWORD");
3 else return false;

redditTestmain.tsx1 match

@charmaine•Updated 18 hours ago
12const isProd = false;
13
14export async function redditAlert({ lastRunAt }: Interval) {
15 if (!SERP_API_KEY || !DISCORD_API_KEY) {
16 console.error("Missing SERP_API_KEY or Discord webhook URL. Exiting.");

redditTestREADME.md2 matches

@charmaine•Updated 18 hours ago
42 - Value: Your SERP API key.
43
44Without this key, the val will not function correctly.
45
46---
58- Key: `mentionsDiscord`
59- Value: Your Discord webhook URL.
60Notifications will be sent using this function:
61```
62 await discordWebhook({

image-inpaintingmain.tsx1 match

@themichaellai•Updated 19 hours ago
8 * Val Town HTTP val – returns the mask-editor page.
9 */
10export default async function(req: Request): Promise<Response> {
11 const body = "<!DOCTYPE html>" + render(<HTML />);
12 return new Response(body, {

image-inpaintingApp.tsx1 match

@themichaellai•Updated 19 hours ago
3import { useEffect, useRef, useState } from "npm:preact/hooks";
4
5export default function App() {
6 const [imageSrc, setImageSrc] = useState<string | null>(null);
7 const [ready, setReady] = useState(false);

image-inpaintinghtml.tsx1 match

@themichaellai•Updated 19 hours ago
4// import { h } from "preact";
5
6export function HTML() {
7 return (
8 <html>

pondiverseaddCreation1 match

@argmn•Updated 19 hours ago
4import { TABLE_NAME } from "./updateTable";
5
6export default async function(req: Request): Promise<Response> {
7 // body contains:
8 // - title (string)

pondiverseupdateTable1 match

@argmn•Updated 19 hours ago
2
3export const TABLE_NAME = "pondiverse_creations_v5";
4export default async function(req: Request): Promise<Response> {
5 await sqlite.execute(
6 `CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (

untitled-7166main.tsx1 match

@welfare•Updated 19 hours ago
1// main.tsx
2
3export default async function(req: Request): Promise<Response> {
4 const url = new URL(req.url);
5

getFileEmail4 file matches

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

tuna8 file matches

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