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=1367&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 17279 results for "function"(2438ms)

bookTheSperryChaletmain.tsx1 match

@mattrw2•Updated 8 months ago
4const datePattern = /\b[A-Za-z]{3}\s\d{1,2}\b/;
5
6export default async function(interval: Interval) {
7 const response = await fetch("https://www.sperrychalet.com/vacancy_s.html");
8 const body = await response.text();

smallwebmain.tsx1 match

@pinjasaur•Updated 8 months ago
3const getText = async url => (await fetch(url)).text();
4
5export default async function(req: Request): Promise<Response> {
6 if (req.headers.get("referer")?.includes("val.")) {
7 return Response.json({ error: "Cannot access from val.town" }, {

rattyAmberLeopardmain.tsx1 match

@git•Updated 8 months ago
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 const passedUrl = url.searchParams.get("url");

fetchIpfsPostsmain.tsx1 match

@stevedylandev•Updated 8 months ago
2let endDate = Math.floor(currentDate.getTime() / 1000);
3let startDate = Math.floor(currentDate.setDate(currentDate.getDate() - 7) / 1000);
4export async function fetchIPFSPosts() {
5 try {
6 const soRes = await fetch(

FunIDorPasswordmain.tsx4 matches

@DFB•Updated 8 months ago
18type FunType = keyof typeof opts
19
20async function generate(opt: keyof typeof opts) {
21 try {
22 const msg = baseMsg(opts[opt])
35}
36
37function parseFunStrings(x: unknown): string[] {
38 if (Array.isArray(x)) {
39 return x.filter(x => typeof x === 'string')
41}
42
43async function getMoreFun(type: FunType, existingFun: string[] = []) {
44 return [...existingFun, ...(await generate(type))]
45}
47const isFunType = (t: string): t is FunType => t in opts
48
49export default async function (req: Request): Promise<Response> {
50 const searchParams = new URL(req.url).searchParams
51 const funType = searchParams.get('type') ?? 'slug'

emailMeWhenBadAirQualitymain.tsx1 match

@bcongdon•Updated 8 months ago
4import process from "node:process";
5
6export async function emailMeWhenBadAirQuality({ lat, long }: {
7 lat: number;
8 long: number;

easyAQImain.tsx1 match

@bcongdon•Updated 8 months ago
7const cacheKey = location => "easyAQI_locationID_cache_" + encodeURIComponent(location);
8
9export async function easyAQI({ location }: {
10 location: string;
11}) {

featureflagsmain.tsx1 match

@fmac•Updated 8 months ago
67};
68
69function getUserId(c: Context): string {
70 return c.req.query("userId")
71 || c.req.header("x-forwarded-for")

FetchBasicmain.tsx1 match

@hunty•Updated 8 months ago
1export default async function(req: Request): Promise<Response> {
2 // Setup CORS Headers
3 const headers = new Headers();

comparableJadePtarmiganmain.tsx1 match

@fahmi•Updated 8 months ago
1export default async function(req: Request): Promise<Response> {
2 const url =
3 "https://script.google.com/macros/s/AKfycbwzkp9Nr29pws2ShKq9ZlI1W-DaLmKBJbGBk8kYuw4bOkmyWvgdE7E6M5d6YwUITekf/exec";

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 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": "*",