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=2379&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 28208 results for "function"(2391ms)

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([

sqliteExplorerAppREADME.md1 match

@robertbrookUpdated 7 months ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query

vtu_generateJWTKeyPairmain.tsx1 match

@rozekUpdated 7 months ago
2import crypto from "node:crypto"
3
4export default async function vtu_generateJWTKeyPair ():Promise<void> {
5 const { privateKey, publicKey } = crypto.generateKeyPairSync('ec', {
6 namedCurve:'P-384',

vtu_JWTisValidmain.tsx1 match

@rozekUpdated 7 months ago
8import { blob } from "https://esm.town/v/std/blob"
9
10export default async function JWTisValid (JWT:string):Promise<boolean> {
11 expectNonEmptyString('JWT',JWT)
12

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.