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/$%7Bart_info.art.src%7D?q=function&page=1755&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 24530 results for "function"(2167ms)

charmainesStatusstatus3 matches

@charmaine•Updated 3 months ago
6import { SparklineSVG } from "./sparklineSVG";
7
8function StatusRow({ rows }) {
9 return (
10 <div className="w-full flex flex-col space-y-2">
28}
29
30function StatusSection({ url, rows }) {
31 const sectionRows = rows.filter(row => row[0] === url);
32 const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
44}
45
46export default async function(req: Request): Promise<Response> {
47 const { rows } = await sqlite.execute(
48 "select url, ok, duration, timestamp from uptime order by timestamp desc limit 200",

allTheFrontendBackendPatternshttp3 matches

@maxm•Updated 3 months ago
3import React, { useState } from "https://esm.sh/react@18.2.0";
4
5function Counter() {
6 const [count, setCount] = useState(4);
7
15}
16
17function client() {
18 createRoot(document.getElementById("root")).render(<Counter />);
19}
23}
24
25export default function server(request: Request): Response {
26 return new Response(
27 `

charmainesStatusnotify1 match

@charmaine•Updated 3 months ago
4const thisURL = parseProject(import.meta.url).links.self.latest;
5
6export async function notify(message: string) {
7 await email({ subject: message, text: `Email sent from ${thisURL}` });
8}

allTheFrontendBackendPatternsfrontend.ts1 match

@maxm•Updated 3 months ago
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
6 const [count, setCount] = useState(4);
7 return (

charmainesStatussparklineSVG1 match

@charmaine•Updated 3 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2export function SparklineSVG({ strokeWidth = 2, data = [], fill = "none", stroke = "black" }) {
3 const padding = 2;
4 const xMargin = 25;

charmainesStatusmonitor1 match

@charmaine•Updated 3 months ago
7);
8
9export async function uptimeCheck(url: string) {
10 let reason: string, status: number, end: number;
11 let ok = true;

allTheFrontendBackendPatternshttpReact1 match

@maxm•Updated 3 months ago
1/** @jsxImportSource npm:react */
2import { renderToString } from "npm:react-dom/server";
3export default async function(req: Request): Promise<Response> {
4 return new Response(
5 renderToString(

allTheFrontendBackendPatternshttp1 match

@maxm•Updated 3 months ago
1export default async function(req: Request): Promise<Response> {
2 return new Response(
3 `

logmeinmw2 matches

@maxm•Updated 3 months ago
7type Handler = (r: Request) => Promise<Response> | Response;
8
9export async function logMeInMiddleware(
10 importMetaUrl: string,
11 handle: Handler,
34}
35
36function htmlTemplateResponse(body: JSX.Element, options?: Partial<ResponseInit>): Response {
37 const headers = { "content-type": "text/html charset=utf-8" };
38 return new Response(

logmeindemo1 match

@maxm•Updated 3 months ago
1import { logMeInMiddleware, LOGOUT_URL, RESET_URL } from "https://esm.town/v/maxm/logmein/mw";
2
3async function handler(req: Request): Promise<Response> {
4 return new Response(
5 `

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.