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/?q=function&page=2750&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 28832 results for "function"(8610ms)

counterTestmain.tsx1 match

@ae_play•Updated 1 year ago
2import { setCounter } from "https://esm.town/v/ae_play/setCounter";
3
4export function counterTest() {
5 setCounter(c => c + 1);
6 console.log(counter);

hnFollowPollJobmain.tsx1 match

@sina•Updated 1 year ago
3import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts?v=18";
4
5export async function hnFollowPollJob({ lastRunAt }) {
6 let posts = await hnLatestPosts({
7 authors: hackerNewsAuthors,

myApimain.tsx1 match

@x2764tech•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@hbd•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

sendTimemain.tsx1 match

@ning•Updated 1 year ago
1export async function sendTime() {
2 console.email(": nice to see you!");
3}

nowCastPMAQImain.tsx1 match

@stungeye•Updated 1 year ago
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
4
5export async function nowCastPMAQI({ location_id }) {
6 const { results } = await fetchJSON(
7 "https://api.openaq.org/v2/measurements?" +

tidbytXmain.tsx3 matches

@andreterron•Updated 1 year ago
1import { tidbytCircle } from "https://esm.town/v/andreterron/tidbytCircle";
2
3export async function tidbytX({ size = 7, bg = 0xffffff80, x: xColor = 0x9d174dff }: {
4 // b91c1c
5 // fecdd3
19 const center = Math.floor(size / 2);
20 img.setPixelColor(xColor, center, center);
21 function* radialSymmetrical(dx: number, dy: number) {
22 yield { x: dx, y: dy };
23 yield { x: -dx, y: -dy };
24 }
25 function* radialSymmetrical4(dx: number, dy: number) {
26 yield { x: dx, y: dy };
27 yield { x: dy, y: -dx };

Countermain.tsx1 match

@wonday•Updated 1 year ago
1let { count } = await import("https://esm.town/v/wonday/count");
2
3export function Counter() {
4 count += 1;
5 return `The count is ${count}`;

myApimain.tsx1 match

@chatgpt•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

uuidmain.tsx1 match

@yieldray•Updated 1 year ago
1export async function uuid(req: express.Request, res: express.Response) {
2 res.set({
3 "Access-Control-Allow-Origin": "*",
tuna

tuna9 file matches

@jxnblk•Updated 2 hours ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.