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/image-url.jpg%20%22Image%20title%22?q=function&page=2111&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 29176 results for "function"(1744ms)

stumbleDropmain.tsx2 matches

@s3thi•Updated 3 months ago
1import { sqlite } from "https://esm.town/v/std/sqlite";
2
3async function getRandomBookmark() {
4 const url = await sqlite.execute(`SELECT url FROM bookmarks ORDER BY RANDOM() LIMIT 1;`);
5 return url.rows[0];
6}
7
8export default async function(req: Request): Promise<Response> {
9 try {
10 const bookmark = await getRandomBookmark();

valentinemain.tsx3 matches

@user172k•Updated 3 months ago
11 "C,mon, you know you like me ;)",
12
13function App() {
14 const [noClicks, setNoClicks] = useState(0);
15 const [isValentine, setIsValentine] = useState(false);
96}
97
98function client() {
99 createRoot(document.getElementById("root")).render(<App />);
100}
101if (typeof document !== "undefined") { client(); }
102
103export default async function server(request: Request): Promise<Response> {
104 return new Response(
105 `

AMBOTHAHAHAHAHAmain.tsx3 matches

@yuaaangabaa•Updated 3 months ago
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
114}
115
116function client() {
117 createRoot(document.getElementById("root")).render(<App />);
118}
119if (typeof document !== "undefined") { client(); }
120
121export default async function server(request: Request): Promise<Response> {
122 return new Response(
123 `

HAHAHAHAHAmain.tsx3 matches

@yuaaangabaa•Updated 3 months ago
10];
11
12function App() {
13 const [noClicks, setNoClicks] = useState(0);
14 const [isValentine, setIsValentine] = useState(false);
111}
112
113function client() {
114 createRoot(document.getElementById("root")).render(<App />);
115}
116if (typeof document !== "undefined") { client(); }
117
118export default async function server(request: Request): Promise<Response> {
119 return new Response(
120 `

LateValentineGiftmain.tsx3 matches

@Inverius•Updated 3 months ago
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
99}
100
101function client() {
102 createRoot(document.getElementById("root")).render(<App />);
103}
104if (typeof document !== "undefined") { client(); }
105
106export default async function server(request: Request): Promise<Response> {
107 return new Response(
108 `

commendableAquaHoverflymain.tsx1 match

@steveruizok•Updated 3 months ago
66};
67
68export default async function(req: Request): Promise<Response> {
69 if (req.method === "GET") {
70 // handle a GET request

uptimeCheckmain.tsx1 match

@stevekrouse•Updated 3 months ago
2
3const MAX_TRIES = 3;
4export async function uptimeCheck(url: string, attempt = 1) {
5 let ok = true;
6 try {

uptimeCheckmain.tsx1 match

@stevekrouse•Updated 3 months ago
2
3const MAX_TRIES = 3;
4export async function uptimeCheck(url: string, attempt = 1) {
5 let ok = true;
6 try {

valentinemain.tsx3 matches

@yuaaangabaa•Updated 3 months ago
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
99}
100
101function client() {
102 createRoot(document.getElementById("root")).render(<App />);
103}
104if (typeof document !== "undefined") { client(); }
105
106export default async function server(request: Request): Promise<Response> {
107 return new Response(
108 `

valentinemain.tsx3 matches

@adnanui•Updated 3 months ago
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
97}
98
99function client() {
100 createRoot(document.getElementById("root")).render(<App />);
101}
102if (typeof document !== "undefined") { client(); }
103
104export default async function server(request: Request): Promise<Response> {
105 return new Response(
106 `
tuna

tuna9 file matches

@jxnblk•Updated 1 day 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.