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=1898&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 22420 results for "function"(2683ms)

randomFavmain.tsx1 match

@karkowg•Updated 10 months ago
1import { randomEmoji } from "https://esm.town/v/karkowg/emojis";
2
3export default async function(req: Request): Promise<Response> {
4 const emoji = randomEmoji();
5

emojismain.tsx1 match

@karkowg•Updated 10 months ago
8export const isEmoji = (emoji: string) => emojiPattern.test(emoji) || emojis.includes(emoji);
9
10export function randomEmoji() {
11 return emojis[randomIn(0, emojis.length - 1)];
12}

changesmain.tsx4 matches

@willthereader•Updated 10 months ago
30};
31
32async function get_val(
33 user: string,
34 val: string,
50}
51
52function show_val(
53 latest_version: number,
54 val: Val,
90 {html`
91 <script type="module">
92 function unescape(str) {
93 return str.replace(
94 /&amp;|&lt;|&gt;|&#39;|&quot;/g,
164});
165
166async function handler(req: Request): Promise<Response> {
167 await track("saolsen.changes", req);
168 return await app.fetch(req);

livestatusmain.tsx1 match

@triozer•Updated 10 months ago
29];
30
31export default async function(req: Request): Promise<Response> {
32 const url = new URL(req.url);
33

greenWrenmain.tsx1 match

@deepfates•Updated 10 months ago
2import { render } from "npm:preact-render-to-string";
3
4export default async function(req: Request) {
5 if (req.method === "POST") {
6 const name = (await req.formData()).get("name");

illustratedPrimermain.tsx1 match

@yawnxyz•Updated 10 months ago
4import { zodToJsonSchema } from "npm:zod-to-json-schema";
5
6export default async function handler(req: Request): Promise<Response> {
7 const input = new URL(req.url).searchParams.get("input") || "modernism";
8

aqimain.tsx1 match

@ari•Updated 10 months ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "waterford connecticut"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

violetFerretmain.tsx1 match

@tempguy•Updated 10 months ago
1import { blob } from "https://esm.town/v/std/blob?v=12";
2export default async function(interval: Interval) {
3 await fetch("https://tempguy-scarletsole.web.val.run/refresh");
4 const date = new Date();

fizzFussmain.tsx1 match

@iamseeley•Updated 10 months ago
82
83// FizzBuzz Microservice
84export default async function(req) {
85 Logger.log("FizzBuzz request received");
86 const startTime = PerformanceTracker.start();

beigeMandrillmain.tsx1 match

@iamseeley•Updated 10 months ago
1export default async function (req: Request): Promise<Response> {
2 const { searchParams } = new URL(req.url);
3

getFileEmail4 file matches

@shouser•Updated 4 weeks 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.