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=1644&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 18949 results for "function"(2399ms)

deno_servermain.tsx1 match

@pomdtr•Updated 1 year ago
1export function denoServer(handler: (req: Request) => Response | Promise<Response>, thisArg?: any) {
2 if (thisArg) {
3 handler = handler.bind(thisArg);

valsmain.tsx1 match

@mxdvl•Updated 1 year ago
18);
19
20export default async function(req: Request) {
21 return new Response(
22 `

denoServermain.tsx1 match

@vladimyr•Updated 1 year ago
1export function denoServer(handler: (req: Request) => Response | Promise<Response>, thisArg?: any) {
2 if (thisArg) {
3 handler = handler.bind(thisArg);

HonoHTMXmain.tsx1 match

@iamseeley•Updated 1 year ago
32);
33
34export default async function(req: Request) {
35 return new Response(
36 `

htmlExamplemain.tsx1 match

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

twitterAlertmain.tsx1 match

@arunc•Updated 1 year ago
4const query = "\"val.town\" OR \"val town\" -_ValTown_";
5
6export async function twitterAlert({ lastRunAt }: Interval) {
7 const results = await twitterSearch({
8 query,

aqimain.tsx1 match

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

ssr_react_minimain.tsx1 match

@flxa•Updated 1 year ago
35
36export const hydrate = (importMetaURL: string) =>
37 async function(req: Request): Promise<Response> {
38 const { author, name } = extractValInfo(importMetaURL);
39 const valURL = `https://www.val.town/v/${author}/${name}`;

telegrammain.tsx4 matches

@stevekrouse•Updated 1 year ago
10 * @param authorization
11 */
12export async function telegramText(text: string, options?: TextOptions, authorization?: string) {
13 return telegramRequest("text", { text, options }, authorization);
14}
20 * @param authorization
21 */
22export async function telegramPhoto(options: PhotoOptions, authorization?: string) {
23 return telegramRequest("photo", { options }, authorization);
24}
25
26async function telegramRequest(path, body, authorization?: string) {
27 const response = await fetch("https://stevekrouse-telegramValTownAPI.web.val.run/" + path, {
28 method: "POST",
47 * @deprecated since 4/20/2024
48 */
49export async function telegram(secret: string, text: string, options?: MergedOptions) {
50 return runVal("stevekrouse.telegramValTownBot", secret, text, options);
51}

telegramValTownAPImain.tsx1 match

@stevekrouse•Updated 1 year ago
42};
43
44function handleTelegramResponse(response) {
45 console.log(response);
46 if (response.ok) {

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": "*",