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=2431&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 28757 results for "function"(6816ms)

apimain.tsx1 match

@romanewmedia•Updated 7 months ago
1export default async function(req: Request): Promise<Response> {
2 // Setup CORS Headers
3 const headers = new Headers();

routineTrackerAppmain.tsx4 matches

@jmt_es•Updated 7 months ago
144};
145
146function App() {
147 const [tareasCompletadas, setTareasCompletadas] = useState([]);
148 const [estadosTemporizador, setEstadosTemporizador] = useState(tareasRutinarias.map(tarea => ({
163 };
164
165 function disparar(proporcionParticulas, opciones) {
166 confetti({
167 ...configuracionPredeterminada,
377}
378
379function client() {
380 createRoot(document.getElementById("root")).render(<App />);
381}
382if (typeof document !== "undefined") { client(); }
383
384async function server(request: Request): Promise<Response> {
385 return new Response(
386 `

dailyStandupBotmain.tsx1 match

@princetonpoh•Updated 7 months ago
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
2
3export default async function() {
4 discordWebhook({
5 url: Deno.env.get("engDiscord"),

pretendingToBeRunmain.tsx4 matches

@maxm•Updated 7 months ago
1export default async function(req: Request): Promise<Response> {
2 // Fork and enable me if you'd like, I did not want to expose my private vals.
3 return new Response("disabled", { status: 500 });
13 });
14 }
15 if (typeof resp.value !== "function") {
16 return Response.json({
17 error: { message: "The first export of this val is not a function and cannot be run with args" },
18 }, {});
19 }
22}
23
24function getMainExport(
25 mod: any,
26): { ok: true; value: any } | { ok: false; error: Error } {

distancemain.tsx1 match

@panphora•Updated 7 months ago
1export default async function distance(req) {
2 const searchParams = new URL(req.url).searchParams;
3 const destinationA = encodeURIComponent(String(searchParams.get("a")).trim());

aqimain.tsx1 match

@alaq•Updated 7 months ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "Brooklyn NY 11206"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

ingeniousSapphireWildebeestmain.tsx1 match

@maxm•Updated 7 months ago
1export default function(a: number, b: number) {
2 return a + b;
3}

sillifierSlangifiermain.tsx3 matches

@yawnxyz•Updated 7 months ago
4import { createRoot } from "https://esm.sh/react-dom/client";
5
6function App() {
7 const [htmlInput, setHtmlInput] = useState("<h1>Hello, World!</h1>"); const [silliness, setSilliness] = useState(0);
8 const [slang, setSlang] = useState(0);
90}
91
92function client() {
93 createRoot(document.getElementById("root")).render(<App />);
94}
98}
99
100async function server(request: Request): Promise<Response> {
101 if (request.method === "POST" && new URL(request.url).pathname === "/api/modify") {
102 const { html, silliness, slang } = await request.json();

leadership_styles_inventorymain.tsx4 matches

@jaredsilver•Updated 7 months ago
41];
42
43function shuffleArray(array) {
44 const shuffled = [...array];
45 for (let i = shuffled.length - 1; i > 0; i--) {
50}
51
52function App() {
53 const [questions, setQuestions] = useState([]);
54 const [currentQuestion, setCurrentQuestion] = useState(0);
222}
223
224function client() {
225 createRoot(document.getElementById("root")).render(<App />);
226}
230}
231
232export default async function server(request: Request): Promise<Response> {
233 return new Response(`
234 <html>

dailyScheduleTrackermain.tsx4 matches

@vandermerwed•Updated 7 months ago
236};
237
238function AnalogueScheduleClock({
239 schedule = defaultSchedule,
240 todoList = defaultTodoList,
340}
341
342function App() {
343 return <AnalogueScheduleClock />;
344}
345
346function client() {
347 const rootElement = document.getElementById("root");
348 if (rootElement) {
357}
358
359export default async function server(request: Request): Promise<Response> {
360 return new Response(
361 `

getFileEmail4 file matches

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

tuna8 file matches

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