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=652&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 10262 results for "function"(451ms)

askSMHI

askSMHItoolSchema1 match

@ljus•Updated 1 month ago
2import * as v from "npm:valibot";
3import { getSmhiForecastResponseZodSchema } from "./schema";
4export async function zodToJSONSchema() {
5 const parameterObj = await getSmhiForecastResponseZodSchema({
6 option: "parameters",

frontierScannersite.http.tsx4 matches

@wolf•Updated 1 month ago
6const API_URL = "https://wolf--63fba038059911f091d7569c3dd06744.web.val.run/";
7
8function CouponCodeSection() {
9 const [couponCode, setCouponCode] = useState("");
10 const [appliedCoupon, setAppliedCoupon] = useState<string | null>(null);
87}
88
89function App() {
90 const [promos, setPromos] = useState<Promo[]>([]);
91 const [loading, setLoading] = useState(true);
159}
160
161function client() {
162 createRoot(document.getElementById("root")!).render(<App />);
163}
165
166// deno-lint-ignore require-await
167export default async function server(_request: Request): Promise<Response> {
168 return new Response(
169 `

HTTP101otherPUTexample1 match

@willthereader•Updated 1 month ago
1import { blob } from "https://esm.town/v/std/blob";
2
3export default async function(req: Request): Promise<Response> {
4 // Start with the actual HTTP method
5 let effectiveMethod = req.method;
Hazreawall

HazreawallSawati1 match

@Video•Updated 1 month ago
1export default async function (e: Email) {
2
3}

testTwiliohttpHandler.ts1 match

@prashamtrivedi•Updated 1 month ago
6 * based on a query parameter.
7 */
8export default async function(req: Request): Promise<Response> {
9 // Parse the URL to get query parameters
10 const url = new URL(req.url);

testTwilioclaudeScript.ts3 matches

@prashamtrivedi•Updated 1 month ago
1import { message as vscodeMessage } from "./vscodeScript.ts";
2
3export function message() {
4 return "This was created by an MCP connected with Claude Code";
5}
6
7// You can call this function directly
8export default function() {
9 const claudeMessage = message();
10 const vscodeInsidersMessage = vscodeMessage();

testTwiliovscodeScript.ts3 matches

@prashamtrivedi•Updated 1 month ago
1export function message() {
2 return "This was created by an MCP running in VSCode Insiders";
3}
4
5// You can call this function directly
6export default function() {
7 return message();
8}

forky_1742582577934App.tsx1 match

@charmaine•Updated 1 month ago
2import { useState } from "https://esm.sh/react@18.2.0";
3
4export function App() {
5 const [projectUrl, setProjectUrl] = useState("");
6 const [apiToken, setApiToken] = useState("");

forky_1742582577934index.ts2 matches

@charmaine•Updated 1 month ago
151});
152
153function parseValTownProjectURL(url) {
154 // Use the URL constructor to parse the URL
155 const { pathname } = new URL(url);
165}
166
167async function getFilesWithContent(authenticatedVT, files, projectId, newProjectId) {
168 console.log("files:", files);
169 const nonDirectoryFiles = files.filter(file => file.type !== "directory");

tank_1742579939417tank.html1 match

@shouser•Updated 1 month ago
1export default function server(request: Request): Response {
2 return new Response(
3 `<!DOCTYPE html>

getFileEmail4 file matches

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

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago