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=959&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 17289 results for "function"(1655ms)

valentinemain.tsx3 matches

@hikmet•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 `

tsEvalworker2 matches

@tmcw•Updated 2 months ago
10
11const workerCode = async (code: string, env: Record<string, string>) => {
12 function createDenoEnvStub(
13 input: Record<string, string>,
14 ): typeof Deno.env {
43};
44
45export function newWorker({ code, env }: { code: string; env: Record<string, string> }) {
46 const workerCodeString = `
47${imports}

tsEvalpatchConsoleLog2 matches

@tmcw•Updated 2 months ago
1type ConsoleMethod = (...args: any[]) => void;
2
3export function patch(cb: (message: string) => void) {
4 const consoleHandler: ProxyHandler<Console> = {
5 get(target: Console, prop: keyof Console) {
6 let originalMethod = target[prop] as ConsoleMethod;
7 if (typeof originalMethod !== "function") {
8 return originalMethod;
9 }

tsEvalindexPage1 match

@tmcw•Updated 2 months ago
3import { renderToString } from "npm:react-dom/server";
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7

tsEvaldummyHTTP1 match

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

Poopisgoodmain.tsx3 matches

@Faafayyy•Updated 2 months ago
14];
15
16function App() {
17 const [noClicks, setNoClicks] = useState(0);
18 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

@rays•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 `

tldraw_computer_examplemain.tsx1 match

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

visionaryRoseBaboonmain.tsx3 matches

@goofygoober•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 `

fascinatingTomatoJunglefowlmain.tsx3 matches

@Chasmish•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 `

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": "*",