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=2062&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 22661 results for "function"(1839ms)

valTownLogo_test2main.tsx1 match

@vladimyr•Updated 1 year ago
6} from "https://esm.town/v/postpostscript/valTownLogo";
7
8export default async function(req: Request): Promise<Response> {
9 const html = `
10 <html>

gfmmain.tsx2 matches

@vladimyr•Updated 1 year ago
1export async function html(markdown: string) {
2 const [
3 { micromark },
15}
16
17export async function gfm(
18 markdown: string,
19 options?: {

aspBadgemain.tsx3 matches

@vladimyr•Updated 1 year ago
24const BADGE_COLOR = "6855c3";
25
26export default async function(req: Request): Promise<Response> {
27 const reqURL = new URL(req.url);
28 if (reqURL.pathname === "/") {
54}
55
56async function getBadgeConfig(aspeUri: string, debug = false): Promise<BadgeConfig> {
57 const config: BadgeConfig = {
58 label: BADGE_LABEL,
77}
78
79async function processAspeUri(aspeUri: string) {
80 let aspeURI: AspeURI | LegacyAspeURI = parseAspeURI(aspeUri);
81 if (!aspeURI) {

appendFragmentmain.tsx1 match

@vladimyr•Updated 1 year ago
1// SPDX-License-Identifier: 0BSD
2
3export function appendFragment(fragment: string, html: string) {
4 if (!fragment) return html;
5 let offset = Math.min(

dailyPelotonEmailRemindermain.tsx1 match

@tarngerine•Updated 1 year ago
4import { isSameDay } from "npm:date-fns";
5
6export default async function checkTodayWorkout() {
7 const data = await fetchPelotonWorkouts(
8 "3f5bf759bb65494d8b35d26ec72b7340",

commentsmain.tsx2 matches

@parkerdavis•Updated 1 year ago
5const KEY = import.meta.url.split("?")[0];
6
7export async function addComment(str) {
8 const comments = await blob.getJSON(KEY) as Array<string> ?? [];
9 comments.push(str);
11 await email({ text: "New Comment Alert!: " + str });
12}
13export async function getComments() {
14 return await blob.getJSON(KEY) as Array<string> ?? [];
15}

brownCoralmain.tsx1 match

@tarngerine•Updated 1 year ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI";
3
4export async function aqi(interval: Interval) {
5 const location = "brooklyn navy yard"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

appendFragment_examplemain.tsx1 match

@vladimyr•Updated 1 year ago
15`.trim();
16
17export default async function(req: Request): Promise<Response> {
18 return new Response(
19 appendFragment(

codeOnValTown_testmain.tsx1 match

@vladimyr•Updated 1 year ago
4const { author, name } = extractValInfo(import.meta.url);
5
6async function serveHtml(req: Request): Promise<Response> {
7 return new Response(
8 `

codeOnValTownmain.tsx2 matches

@vladimyr•Updated 1 year ago
9 * @param val Define which val should open. Defaults to the root reference.
10 */
11export function modifyHtmlString(
12 bodyText: string,
13 { val, style }: { val?: ValRef; style?: string } = {},
40 * @param val Define which val should open
41 */
42export function modifyFetchHandler(
43 handler: RequestHandler,
44 { val, style }: { val?: ValRef; style?: string } = {},

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.