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=1652&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 18853 results for "function"(2640ms)

testmain.tsx1 match

@d•Updated 1 year ago
1export function test(){
2 return Math.random();
3}

htmlExamplemain.tsx1 match

@Llad•Updated 1 year ago
1// View at https://andreterron-htmlExample.web.val.run?name=Andre
2export default async function(req: Request): Promise<Response> {
3 const query = new URL(req.url).searchParams;
4

yellowToadmain.tsx2 matches

@simonw•Updated 1 year ago
2
3const script = `
4def mapFunction(r, i):
5 v = r * i
6 return v
8x = [1, 2, 3, 4]
9x
10 .map(mapFunction)
11 .filter(r => r * r)
12 .join(",")

jsPythonmain.tsx2 matches

@stevekrouse•Updated 1 year ago
2
3const script = `
4def mapFunction(r, i):
5 v = r * i
6 return v
8x = [1, 2, 3, 4]
9x
10 .map(mapFunction)
11 .filter(r => r * r)
12 .join(",")

jsPythonmain.tsx2 matches

@simonw•Updated 1 year ago
3 const { jsPython } = await import("npm:jspython-interpreter");
4 const script = `
5def mapFunction(r, i):
6 v = r * i
7 return v
9x = [1, 2, 3, 4]
10x
11 .map(mapFunction)
12 .filter(r => r * r)
13 .join(",")

latestBlogContentmain.tsx1 match

@simonw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function latestBlogContent() {
4 return (
5 await fetch(

btcPriceAlertmain.tsx1 match

@jain•Updated 1 year ago
4import { currency } from "https://esm.town/v/stevekrouse/currency";
5
6export async function btcPriceAlert() {
7 const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8 let btcPrice = await currency("usd", "btc");

openaiUploadFilemain.tsx1 match

@yawnxyz•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function openaiUploadFile({ key, data, filename = "data.json", purpose = "assistants" }: {
4 key: string;
5 data: any;

faviconmain.tsx1 match

@pomdtr•Updated 1 year ago
1export default function(req) {
2 const url = new URL(req.url);
3 if (url.pathname == "/val-town") {

codeOnVT_modifyResponsemain.tsx1 match

@andreterron•Updated 1 year ago
7 * @param val Define which val should open. Defaults to the root reference.
8 */
9export function modifyResponse(
10 res: Response,
11 { val, style }: { val?: ValRef; style?: string } = {},

getFileEmail4 file matches

@shouser•Updated 2 weeks ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",