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/image-url.jpg%20%22Optional%20title%22?q=function&page=2119&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 22663 results for "function"(1684ms)

emailRandomJokemain.tsx1 match

@priya_singh_14•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

createSubscribersmain.tsx1 match

@petermillspaugh•Updated 1 year ago
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function createSubscribers() {
4 await sqlite.execute(
5 `

htmlmain.tsx3 matches

@lbb00•Updated 1 year ago
1function getValue(value: unknown) {
2 if (value instanceof Function) {
3 return getValue(value());
4 }
9}
10
11export function html(strings: TemplateStringsArray, ...values: unknown[]) {
12 const len = strings.length;
13 return strings.reduce((renderStr, str, idx) => {

emailRandomJokemain.tsx1 match

@shellypao•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

emailRandomJokemain.tsx1 match

@madi_singlak•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

emailRandomJokemain.tsx1 match

@pjc8889•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

emailRandomJokemain.tsx1 match

@aku7703•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

rateLimitedAsyncPoolmain.tsx2 matches

@harryhood•Updated 1 year ago
1import { asyncPool } from "https://esm.town/v/harryhood/asyncPool";
2
3// A generic utility function that handles concurrency and rate-limiting
4export async function rateLimitedAsyncPool<T, V>(
5 items: T[],
6 poolLimit: number,

rateLimitedAsyncPoolREADME.md2 matches

@harryhood•Updated 1 year ago
1## Summary
2
3This function allows you to run a rate limited async pool to make sure no more than `poolLimit` items at a time are run for a given `waitTime`.
4
5## Example Usage
6
7```
8async function fetchURL(url: string): Promise<string[]> {
9 const response = await fetch(url);
10 const html = await response.text();

asyncPoolmain.tsx1 match

@harryhood•Updated 1 year ago
1export async function asyncPool<T, V>(
2 array: T[],
3 poolLimit: number,

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.