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=1944&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 23865 results for "function"(2178ms)

oliveGardenCharmain.tsx4 matches

@charmaineUpdated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [coworkers, setCoworkers] = useState([]);
7 const [newCoworker, setNewCoworker] = useState("");
107}
108
109function SwipeToDelete({ children, onDelete }) {
110 const [startX, setStartX] = useState(null);
111 const [offset, setOffset] = useState(0);
151}
152
153function client() {
154 createRoot(document.getElementById("root")).render(<App />);
155}
156if (typeof document !== "undefined") { client(); }
157
158export default async function server(request: Request): Promise<Response> {
159 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
160 const SCHEMA_VERSION = 2;

healthtech4africamain.tsx3 matches

@thomaskangahUpdated 7 months ago
5const countries = ["Kenya", "India"];
6
7function App() {
8 const [country, setCountry] = useState("");
9 const [userId, setUserId] = useState("");
150}
151
152function client() {
153 createRoot(document.getElementById("root")).render(<App />);
154}
158}
159
160export default async function server(request: Request): Promise<Response> {
161 const { OpenAI } = await import("https://esm.town/v/std/openai");
162 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

tldrawclientmain.tsx1 match

@robcobbUpdated 7 months ago
6import { Tldraw } from "https://esm.sh/tldraw@2.1.0";
7
8export function App() {
9 return (
10 <>

hello_worldmain.tsx1 match

@stevekrouseUpdated 7 months ago
1export default async function(req: Request): Promise<Response> {
2 return Response.json("hello world!");
3}

vtu_readUsermain.tsx1 match

@rozekUpdated 7 months ago
6import { blob } from "https://esm.town/v/std/blob"
7
8export default async function readUser (UserId:string):Promise<any> {
9 expectEMailAddress('user id',UserId)
10

vtu_deleteUsermain.tsx1 match

@rozekUpdated 7 months ago
5import { blob } from "https://esm.town/v/std/blob"
6
7export default async function deleteUser (UserId:string):Promise<void> {
8 expectEMailAddress('user id',UserId)
9

vtu_updateUsermain.tsx1 match

@rozekUpdated 7 months ago
7import PBKDF2Hash from 'https://esm.town/v/rozek/vtu_PBKDF2Hash'
8
9export default async function updateUser (
10 UserId:string, Password?:string, Roles?:string
11):Promise<void> {

vtu_createUsermain.tsx1 match

@rozekUpdated 7 months ago
7import PBKDF2Hash from 'https://esm.town/v/rozek/vtu_PBKDF2Hash'
8
9export default async function createUser (
10 UserId:string, Password:string, Roles:string = 'user'
11):Promise<void> {

vtu_ListOfUserIdsmain.tsx1 match

@rozekUpdated 7 months ago
1import { blob } from "https://esm.town/v/std/blob"
2
3export default async function ListOfUserIds ():Promise<string[]> {
4 return (await blob.list('vtu_User_')).map((Info:any) => Info.key.slice(9))
5}

vtu_TestSupportmain.tsx19 matches

@rozekUpdated 7 months ago
6const SkipIndicator = '⏭️ [SKIP]: '
7
8let beforeEachFns:Function[] = []
9let afterEachFns:Function[] = []
10let beforeAllFns:Function[] = []
11let afterAllFns:Function[] = []
12
13/**** describe ****/
14
15export async function describe (
16 CollectionName:string, Collection:Function
17):Promise<void> {
18 const outerBeforeEachFns = beforeEachFns; beforeEachFns = []
41/**** xdescribe ****/
42
43export async function xdescribe (
44 CollectionName:string, Collection:Function
45):Promise<void> {
46 console.log(SkipIndicator + CollectionName)
49/**** it ****/
50
51export async function it (
52 SpecName:string, Spec:Function, Timeout:number = 2000
53) {
54 try {
73/**** xit ****/
74
75export function xit (
76 SpecName:string, Spec:Function, Timeout:number = 2000
77) {
78 console.log(SkipIndicator + SpecName)
81/**** fail ****/
82
83export function fail (Message:string):void {
84 throw new Error(Message)
85}
87/**** before/afterAll/Each ****/
88
89export function beforeAll (Handler:Function):void { beforeAllFns.push(Handler) }
90export function afterAll (Handler:Function):void { afterAllFns.push(Handler) }
91export function beforeEach(Handler:Function):void { beforeEachFns.push(Handler) }
92export function afterEach (Handler:Function):void { afterEachFns.push(Handler) }
93
94/**** runWithTimeout ****/
95
96async function runWithTimeout(
97 Handler:Function, Timeout:number
98):Promise<void> {
99 return Promise.race([

getFileEmail4 file matches

@shouserUpdated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblkUpdated 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.