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=1669&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 20491 results for "function"(3241ms)

untitled_azureWhippetmain.tsx1 match

@jordonezrodri2•Updated 8 months ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

weeklyTanPonymain.tsx1 match

@stevekrouse•Updated 8 months ago
1// This val demonstrates how to handle form data and display it back to the user
2
3export default async function server(req: Request): Promise<Response> {
4 if (req.method === 'POST') {
5 const formData = await req.formData();

hungryWhiteLeoponmain.tsx3 matches

@gr8gatsby•Updated 8 months ago
12import { createRoot } from "https://esm.sh/react-dom/client";
13
14function App() {
15 const [coffeeShops, setCoffeeShops] = useState([]);
16 const [reviews, setReviews] = useState([]);
163}
164
165function client() {
166 createRoot(document.getElementById("root")).render(<App />);
167}
168if (typeof document !== "undefined") { client(); }
169
170async function server(request: Request): Promise<Response> {
171 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
172 const url = new URL(request.url);

addToLogmain.tsx3 matches

@ejfox•Updated 8 months ago
14}
15
16function App() {
17 const [messages, setMessages] = useState<Message[]>([]);
18 const [newMessage, setNewMessage] = useState("");
92}
93
94function client() {
95 createRoot(document.getElementById("root")!).render(<App />);
96}
100}
101
102async function server(request: Request): Promise<Response> {
103 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
104 const SCHEMA_VERSION = 1;

fileToDataURLmain.tsx2 matches

@stevekrouse•Updated 8 months ago
1export async function fileToDataURL(file: File) {
2 const base64String = await fileToBase64(file);
3
9}
10
11export async function fileToBase64(file: File) {
12 // Read the file as an ArrayBuffer
13 const arrayBuffer = await file.arrayBuffer();

inventorymain.tsx3 matches

@ejfox•Updated 8 months ago
159];
160
161function App() {
162 const [selectedTech, setSelectedTech] = useState([]);
163 const [showInventory, setShowInventory] = useState(false);
251}
252
253function client() {
254 createRoot(document.getElementById("root")).render(<App />);
255}
257if (typeof document !== "undefined") { client(); }
258
259async function server(request: Request): Promise<Response> {
260 return new Response(
261 `

techstackinventorymain.tsx3 matches

@ejfox•Updated 8 months ago
14};
15
16function App() {
17 const [selectedTech, setSelectedTech] = useState({});
18
64}
65
66function client() {
67 createRoot(document.getElementById("root")).render(<App />);
68}
69if (typeof document !== "undefined") { client(); }
70
71async function server(request: Request): Promise<Response> {
72 return new Response(`
73 <!DOCTYPE html>

forwardermain.tsx1 match

@stevekrouse•Updated 8 months ago
5const { author, name } = extractValInfo(import.meta.url);
6
7export async function forwarder(e: Email) {
8 let attachments: AttachmentData[] = [];
9 for (const f of e.attachments) {

forwardermain.tsx1 match

@maxm•Updated 8 months ago
5const { author, name } = extractValInfo(import.meta.url);
6
7export async function forwarder(e: Email) {
8 let attachments: AttachmentData[] = [];
9 for (const f of e.attachments) {

isMyWebsiteDownmain.tsx1 match

@rareadmin•Updated 8 months ago
6);
7
8export async function uptimeCheck(url: string) {
9 let ok = true;
10 let reason: string;

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 3 weeks ago
Simple functional CSS library for Val Town
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.