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=1643&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 18182 results for "function"(4968ms)

miniWidgetmain.tsx3 matches

@wilt•Updated 1 year ago
4import { tinyLogomark } from "https://esm.town/v/wilt/tinyLogomark";
5
6export async function miniWidget(request: Request): Promise<Response> {
7 switch (new URL(request.url).pathname) {
8 case "/":
119 event.waitUntil(renderWidget(event.widget));
120})
121async function renderWidget(widget) {
122 console.log(widget);
123 if (!widget) return;
134 event.waitUntil(updateWidgets());
135});
136async function updateWidgets() {
137 const widget = await self.widgets.getByTag("simplepwa");
138 renderWidget(widget);

deno_deploymain.tsx2 matches

@pomdtr•Updated 1 year ago
65}
66
67async function run(payload: sunbeam.Payload<typeof manifest>) {
68 switch (payload.command) {
69 case "dashboard": {
212}
213
214function fetchDeployAPI(endpoint: string, init?: RequestInit) {
215 return fetch(`https://dash.deno.com/api${endpoint}`, {
216 ...init,

nixpkgsmain.tsx1 match

@pomdtr•Updated 1 year ago
14} as const satisfies sunbeam.Manifest;
15
16async function search(query: string): Promise<sunbeam.ListItem[]> {
17 if (query.length === 0) return [];
18

evaluatormain.tsx1 match

@atlae•Updated 1 year ago
1import { ReverseComplement } from "https://esm.town/v/atlae/ReverseComplement";
2
3export function evaluator(args: String) {
4 let func, input;
5 [func, input] = args.trim().split(",");

rssProxymain.tsx1 match

@lchtao26•Updated 1 year ago
8};
9
10export default async function(request: Request): Promise<Response> {
11 const feedUrl = getFeedUrl(request);
12 if (!feedUrl) {

staticmain.tsx1 match

@pomdtr•Updated 1 year ago
10const { author, name } = extractValInfo(import.meta.url);
11
12async function extractStaticContent(code: string) {
13 const blob = new Blob([code], { type: "text/javascript" });
14 const url = URL.createObjectURL(blob);

myApimain.tsx1 match

@atlae•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

watchNimbusDammain.tsx1 match

@chet•Updated 1 year ago
1import { watchWebsite } from "https://esm.town/v/chet/watchWebsite";
2
3export default async function(interval: Interval) {
4 await watchWebsite("https://cdec.water.ca.gov/dynamicapp/QueryRES?s=NAT");
5}

datetimemain.tsx3 matches

@tudorizer•Updated 1 year ago
1export default async function(req: Request): Promise<Response> {
2 interface DateTimeFormatsOutput {
3 iso: string;
5 }
6
7 function getSpecificDateTime(): Date {
8 return new Date();
9 }
10
11 function generateDateTimeFormatsOutput(): DateTimeFormatsOutput {
12 const specificDateTime = getSpecificDateTime();
13

minifyHTMLmain.tsx1 match

@yieldray•Updated 1 year ago
5const decoder = new TextDecoder();
6
7export async function minifyHTML(html: string, options?: Partial<MinifyHTMLOptions>) {
8 return decoder.decode(minify(encoder.encode(html), options));
9}

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