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/$%7Burl%7D?q=function&page=2355&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 27947 results for "function"(3662ms)

GDI_AITranslatormain.tsx3 matches

@rozek•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [germanText, setGermanText] = useState("");
7 const [englishTranslation, setEnglishTranslation] = useState("");
61}
62
63function client() {
64 createRoot(document.getElementById("root")).render(<App />);
65}
69}
70
71export default async function server(request: Request): Promise<Response> {
72 return new Response(
73 `

createGithubIssueREADME.md1 match

@stevekrouse•Updated 7 months ago
1This helper function creates a Github Issue in the specified repo,
2assigned to whoever you want. It also adds it into the current
3milestone.

SSEDemomain.tsx1 match

@maxm•Updated 7 months ago
1const msg = new TextEncoder().encode("data: hello\r\n\r\n");
2
3export default async function(req: Request): Promise<Response> {
4 let timerId: number | undefined;
5 const body = new ReadableStream({

GDI_SSEmain.tsx3 matches

@rozek•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [countdown, setCountdown] = useState("");
7 const [isRunning, setIsRunning] = useState(false);
53}
54
55function client() {
56 createRoot(document.getElementById("root")).render(<App />);
57}
61}
62
63export default async function server(request: Request): Promise<Response> {
64 return new Response(
65 `

GDI_SSEServicemain.tsx1 match

@rozek•Updated 7 months ago
1export default async function (req: Request): Promise<Response> {
2 // Only handle GET requests
3 if (req.method !== 'GET') {

sseDemoCountdownmain.tsx1 match

@maxm•Updated 7 months ago
1export default async function(req: Request): Promise<Response> {
2 let count = 10;
3 const body = new ReadableStream({

daringRoseShrewmain.tsx2 matches

@stevekrouse•Updated 7 months ago
1const msg = new TextEncoder().encode("💩");
2const initialDelay = 20;
3export default async function(req: Request): Promise<Response> {
4 let timerId: number | undefined;
5 const body = new ReadableStream({
6 start(controller) {
7 let currentDelay = initialDelay;
8 function writeToStream() {
9 currentDelay *= 1.03;
10 controller.enqueue(msg);

pageSpeedAPImain.tsx5 matches

@eligosmlytics•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function Popup({ isOpen, onClose, content }) {
6 if (!isOpen) return null;
7
43}
44
45function HTMLPreview({ html, isFullView, toggleView }) {
46 return (
47 <div className="html-preview-container">
62}
63
64function App() {
65 const [url, setUrl] = useState('');
66 const [results, setResults] = useState(null);
256}
257
258function client() {
259 createRoot(document.getElementById("root")).render(<App />);
260}
264}
265
266export default async function server(request: Request): Promise<Response> {
267 const url = new URL(request.url);
268

pageDetectormain.tsx3 matches

@eligosmlytics•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [url, setUrl] = useState("");
7 const [result, setResult] = useState(null);
211}
212
213function client() {
214 createRoot(document.getElementById("root")).render(<App />);
215}
219}
220
221export default async function server(request: Request): Promise<Response> {
222 const url = new URL(request.url).searchParams.get("url");
223

GDI_DeepThoughtmain.tsx3 matches

@rozek•Updated 7 months ago
4import deepThinkAbout from "https://esm.town/v/rozek/GDI_deepThinkAbout";
5
6function App() {
7 const [answer, setAnswer] = useState("");
8 const [isThinking, setIsThinking] = useState(false);
36}
37
38function client() {
39 createRoot(document.getElementById("root")).render(<App />);
40}
44}
45
46export default async function server(request: Request): Promise<Response> {
47 return new Response(
48 `

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.