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=991&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 17970 results for "function"(1894ms)

reactRouter7index.ts3 matches

@justbe•Updated 2 months ago
1import { ActionFunctionArgs, LoaderFunctionArgs } from "npm:react-router";
2import aboutLoader from "./about.loader.ts";
3import About from "./about.tsx";
15 // imports the correct one to avoid putting the server code in client
16 // bundles
17 async loader(args: LoaderFunctionArgs) {
18 let mod = await (isServer
19 ? import("./layout.server.ts")
23 // same with the action, you'll probably want to abstract this kind of stuff
24 // in a createRoute() kind of thing
25 async action(args: ActionFunctionArgs) {
26 let mod = await (isServer
27 ? import("./layout.server.ts")

reactRouter7home.tsx1 match

@justbe•Updated 2 months ago
1/** @jsxImportSource npm:react */
2
3export default function Home() {
4 return <h1>Home</h1>;
5}

reactRouter7entry.server.tsx1 match

@justbe•Updated 2 months ago
7let { query, dataRoutes } = createStaticHandler(routes);
8
9export async function handler(request: Request) {
10 // 1. run actions/loaders to get the routing context with `query`
11 let context = await query(request);

reactRouter7about.loader.ts1 match

@justbe•Updated 2 months ago
1import { data } from "npm:react-router";
2
3export default async function load() {
4 await new Promise(resolve => setTimeout(resolve, 200));
5

valentinemain.tsx3 matches

@PhantomKingdom•Updated 2 months ago
18];
19
20function App() {
21 const [noClicks, setNoClicks] = useState(0);
22 const [isValentine, setIsValentine] = useState(false);
113}
114
115function client() {
116 createRoot(document.getElementById("root")).render(<App />);
117}
118if (typeof document !== "undefined") { client(); }
119
120export default async function server(request: Request): Promise<Response> {
121 return new Response(
122 `

valentine_sabelomain.tsx3 matches

@devSlayer•Updated 2 months ago
20];
21
22function App() {
23 const [noClicks, setNoClicks] = useState(0);
24 const [isValentine, setIsValentine] = useState(false);
139}
140
141function client() {
142 createRoot(document.getElementById("root")).render(<App />);
143}
147}
148
149export default async function server(request: Request): Promise<Response> {
150 return new Response(
151 `

valentinemain.tsx3 matches

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

valentinemain.tsx4 matches

@saeed0x53•Updated 2 months ago
13];
14
15function preloadImage(src: string): Promise<HTMLImageElement> {
16 return new Promise((resolve, reject) => {
17 const img = new Image();
22}
23
24function App() {
25 const [noClicks, setNoClicks] = useState(0);
26 const [isValentine, setIsValentine] = useState(false);
420}
421
422function client() {
423 createRoot(document.getElementById("root")).render(<App />);
424}
425if (typeof document !== "undefined") { client(); }
426
427export default async function server(request: Request): Promise<Response> {
428 return new Response(
429 `

convivialAmberLungfishmain.tsx3 matches

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

snugTurquoiseGiraffemain.tsx3 matches

@Erasyl•Updated 2 months ago
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
124}
125
126function client() {
127 createRoot(document.getElementById("root")).render(<App />);
128}
132}
133
134export default async function server(request: Request): Promise<Response> {
135 return new Response(
136 `

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",