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=2331&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 27677 results for "function"(7138ms)

GDI_FileUploadmain.tsx3 matches

@all•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [file, setFile] = useState(null);
7 const [fileName, setFileName] = useState("");
131}
132
133function client() {
134 const root = document.getElementById("root");
135 if (root) {
142}
143
144export default async function server(request: Request): Promise<Response> {
145 return new Response(
146 `

GDI_FileUploadmain.tsx3 matches

@rozek•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [file, setFile] = useState(null);
7 const [fileName, setFileName] = useState("");
131}
132
133function client() {
134 const root = document.getElementById("root");
135 if (root) {
142}
143
144export default async function server(request: Request): Promise<Response> {
145 return new Response(
146 `

GDI_FileUploadServicemain.tsx1 match

@rozek•Updated 8 months ago
1export default async function (req: Request): Promise<Response> {
2 if (req.method !== 'POST') {
3 return new Response('Please send a POST request with a file', { status: 405 });

GDI_StatusCodeServicemain.tsx1 match

@rozek•Updated 8 months ago
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 const path = url.pathname.slice(1); // Remove leading slash

GDI_URLParserServicemain.tsx1 match

@rozek•Updated 8 months ago
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 const path = url.pathname;

GDI_ServerTimeServicemain.tsx2 matches

@rozek•Updated 8 months ago
1export default async function(req: Request): Promise<Response> {
2 const now = new Date();
3 const hours = now.getHours().toString().padStart(2, "0");
12}
13
14function generateTimeAsciiArt(time: string): string {
15 const digits = {
16 "0": [

GDI_HelloWorldServicemain.tsx1 match

@rozek•Updated 8 months ago
1export default async function (req: Request): Promise<Response> {
2 const asciiArt = `
3 _ _ _ _ __ __ _ _ _

GDI_TemperatureConvertermain.tsx4 matches

@rozek•Updated 8 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function TemperatureConverter() {
6 const [celsius, setCelsius] = useState('');
7 const [fahrenheit, setFahrenheit] = useState('');
46}
47
48function App() {
49 return (
50 <div className="container">
54}
55
56function client() {
57 const root = document.getElementById('root');
58 if (root) {
65}
66
67export default async function server(request: Request): Promise<Response> {
68 return new Response(`
69 <html>

GDI_AnalogClockmain.tsx5 matches

@rozek•Updated 8 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function AnalogClock({ time }) {
6 const hourMarks = Array.from({ length: 12 }, (_, i) => i);
7 const minuteMarks = Array.from({ length: 60 }, (_, i) => i);
38}
39
40function App() {
41 const [time, setTime] = useState(new Date());
42
61}
62
63function client() {
64 const root = document.getElementById('root');
65 if (root) {
72}
73
74export default async function server(request: Request): Promise<Response> {
75 return new Response(`
76 <html>
156 transform: rotate(90deg);
157 transition: all 0.05s;
158 transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1);
159}
160

GDI_DigitalClockmain.tsx3 matches

@rozek•Updated 8 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [time, setTime] = useState(new Date());
7
30}
31
32function client() {
33 const root = document.getElementById('root');
34 if (root) {
41}
42
43export default async function server(request: Request): Promise<Response> {
44 return new Response(`
45 <html>

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.