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=1640&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 18199 results for "function"(2783ms)

twemojimain.tsx4 matches

@stevedylandev•Updated 1 year ago
10const UFE0Fg = /\uFE0F/g;
11
12export function getIconCode (char: string) {
13 return toCodePoint(!char.includes(U200D) ? char.replace(UFE0Fg, "") : char);
14}
15
16function toCodePoint (unicodeSurrogates: string) {
17 const r = [];
18 let c = 0;
56const emojiCache: Record<string, Promise<string>> = {};
57
58export async function loadEmoji (type: keyof typeof apis, code: string) {
59 const key = `${type}:${code}`;
60
69 const api = apis[type];
70
71 if (typeof api === "function") {
72 return (emojiCache[key] = fetch(api(code)).then(async r => r.text()));
73 }

powderNotifyCronmain.tsx1 match

@chet•Updated 1 year ago
1import { powderNotify } from "https://esm.town/v/chet/powderNotify";
2
3export default async function(interval: Interval) {
4 await Promise.all([
5 powderNotify("Truckee, CA"),

sailingNotifyCronmain.tsx1 match

@chet•Updated 1 year ago
3import process from "node:process";
4
5export async function sailingNotifyCron({ lastRunAt }) {
6 const result = await sailingNotify("Fair Oaks, CA", 10);
7}

frostNotifyCronmain.tsx1 match

@chet•Updated 1 year ago
2import process from "node:process";
3
4export async function frostNotifyCron(interval: Interval) {
5 await frostNotify("Fair Oaks, CA");
6}

frostNotifymain.tsx1 match

@chet•Updated 1 year ago
2import { email } from "https://esm.town/v/std/email";
3
4export async function frostNotify(
5 where: string,
6 minTempF = 33,

sailingNotifymain.tsx1 match

@chet•Updated 1 year ago
2import { email } from "https://esm.town/v/std/email";
3
4export async function sailingNotify(
5 where: string,
6 minWindMph = 10,

getWeathermain.tsx1 match

@chet•Updated 1 year ago
3
4/** Must set process.env.WEATHER_API_KEY for weatherapi.com **/
5export async function getWeather(
6 query: string,
7 days = 10,

greenhouseToRSSmain.tsx1 match

@donmccurdy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function greenhouseToRSS(req: Request) {
4 const { Feed } = await import("npm:feed");
5 const searchParams = new URL(req.url).searchParams;

leverToRSSmain.tsx1 match

@donmccurdy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function leverToRSS(req: Request) {
4 const { Feed } = await import("npm:feed");
5 const { XMLParser } = await import("npm:fast-xml-parser");

createValmain.tsx1 match

@neverstew•Updated 1 year ago
30}
31
32export function createVal({ token, code, name, readme, privacy }: CreateValArgs): Promise<ValResponse> {
33 const body: Record<string, unknown> = {
34 code,

getFileEmail4 file matches

@shouser•Updated 1 week 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": "*",