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=2108&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 30610 results for "function"(5277ms)

twitterNewTweetAlertmain.tsx5 matches

@socialdata•Updated 2 months ago
71}
72
73export default async function(req: Request): Promise<Response> {
74 if (req.method !== "POST") {
75 return new Response("This Val can only process POST requests from SocialData", {
109}
110
111function generateDiscordPayload(event: NewTweetEvent): any {
112 const tweet = event.data;
113 const user = tweet.user;
163}
164
165async function sendEventToDiscord(event: NewTweetEvent): Promise<void> {
166 const payload = generateDiscordPayload(event);
167
179}
180
181async function sendEventToTelegram(event: NewTweetEvent): Promise<void> {
182 const tweet = event.data;
183 const user = tweet.user;
248}
249
250async function sendPhotoToTelegram(photoUrl: string): Promise<void> {
251 const telegramApiUrl = `https://api.telegram.org/bot${telegramBotApiToken}/sendPhoto`;
252

lilloggyserver.ts1 match

@mavdotjs•Updated 2 months ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

bluffItgame.ts1 match

@mavdotjs•Updated 2 months ago
3const wooter = new Wooter();
4
5export default async function(req: Request): Promise<Response> {
6 return wooter.fetch(req);
7}

todaymain.tsx1 match

@paradiso•Updated 2 months ago
1export default async function server(request: Request): Promise<Response> {
2 // Dynamically import blob storage (server-side only)
3 const { blob } = await import("https://esm.town/v/std/blob");

Framermain.tsx1 match

@paradiso•Updated 2 months ago
1export default async function (interval: Interval) {
2
3}

forkyApp.tsx1 match

@std•Updated 2 months 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("");

forkyindex.ts2 matches

@std•Updated 2 months ago
121});
122
123function parseValTownProjectURL(url) {
124 // Use the URL constructor to parse the URL
125 const { pathname } = new URL(url);
135}
136
137async function getFilesWithContent(authenticatedVT, files, projectId, newProjectId) {
138 console.log("files:", files);
139 const nonDirectoryFiles = files.filter(file => file.type !== "directory");

charBuildIdeaScalehttp.tsx4 matches

@dcm31•Updated 2 months ago
12}
13
14function App({ initialEmail, initialIdeas }: AppProps) {
15 // Placeholder for client-side implementation
16 return (
33
34// Server-side rendering of the static shell
35function Shell({ initialEmail, initialIdeas }: AppProps) {
36 return (
37 <html lang="en">
95export { App };
96
97// Handler function that gets wrapped with lastlogin
98async function handler(request: Request): Promise<Response> {
99 // Get user email from lastlogin headers
100 const email = request.headers.get("X-LastLogin-Email");

marvelousScarletAntlionmain.tsx3 matches

@stevekrouse•Updated 2 months ago
4import { db } from "https://esm.town/v/sqlite/db";
5
6function App() {
7 const [searchTerm, setSearchTerm] = useState("");
8 const [searchResults, setSearchResults] = useState([]);
88}
89
90function client() {
91 createRoot(document.getElementById("root")).render(<App />);
92}
96}
97
98export default async function server(request: Request): Promise<Response> {
99 const url = new URL(request.url);
100

marvelousScarletAntlionmain.tsx3 matches

@stevekrouse•Updated 2 months ago
4import { db } from "https://esm.town/v/sqlite/db";
5
6function App() {
7 const [searchTerm, setSearchTerm] = useState("");
8 const [searchResults, setSearchResults] = useState([]);
88}
89
90function client() {
91 createRoot(document.getElementById("root")).render(<App />);
92}
96}
97
98export default async function server(request: Request): Promise<Response> {
99 const url = new URL(request.url);
100
tuna

tuna9 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.