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=1721&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 18011 results for "function"(3041ms)

hnClojuremain.tsx1 match

@mjdUpdated 1 year ago
3import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts?v=18";
4
5export async function hnClojure({ lastRunAt }: Interval) {
6 let posts = await hnLatestPosts({
7 query: "clojure",

getEmojismain.tsx1 match

@shellphonUpdated 1 year ago
1export async function getEmojis(num, isRandom = false) {
2 const { default: emojis } = await import("npm:emojis-list");
3 if (isRandom) {

commentsmain.tsx1 match

@neverstewUpdated 1 year ago
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export function comments({ token, relationship, since, until, offset, limit }: {
5 token: string;
6 relationship?: "received" | "given" | "any";

untitled4881419main.tsx1 match

@byrnemlUpdated 1 year ago
8}
9
10export async function giveMeLeNews({ feedlyAPI }: LeNews) {
11 return "Works";
12}

hnMuteStorymain.tsx1 match

@andre_hUpdated 1 year ago
1let { hnBlockList } = await import("https://esm.town/v/andre_h/hnBlockList");
2
3export function hnMuteStory(id) {
4 console.log(`Muting story ${id}`);
5 hnBlockList = [...(hnBlockList ?? []), id];

dailyMathFactmain.tsx1 match

@andrewnUpdated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export async function dailyMathFact() {
4 let mathFact = await fetchText(
5 "http://numbersapi.com/random/math",

myApimain.tsx1 match

@andrewnUpdated 1 year ago
1export function myApi() {
2 return { something: "is happening" };
3}

myApimain.tsx1 match

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

btrdb_kv_examplemain.tsx2 matches

@yuuzaUpdated 1 year ago
10 await db.createSet("signData");
11 // 封装 get/set 操作
12 function getData(chatId, userId) {
13 return db.getSet("signData").get([chatId, userId]);
14 }
15 function setData(chatId, userId, data) {
16 return db.getSet("signData").set([chatId, userId], data);
17 }

waitmain.tsx1 match

@ju2l0rUpdated 1 year ago
1export async function wait(ms) {
2 await new Promise((resolve) => setTimeout(resolve, ms));
3}

getFileEmail4 file matches

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

tuna8 file matches

@jxnblkUpdated 1 week 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": "*",