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=1545&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 18011 results for "function"(2298ms)

harlequinCobramain.tsx1 match

@stevekrouse•Updated 12 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(city: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${city}?format=j1`);
5}

rssNotifyExamplemain.tsx1 match

@stevekrouse•Updated 12 months ago
4import RssParser from "npm:rss-parser";
5
6export async function rssNotify() {
7 const lastRunAt = await blob.getJSON(getLegacyImportUrl(import.meta.url));
8 console.log(`Last run: ${lastRunAt || "Never"}`);

emeraldGuanmain.tsx1 match

@stevekrouse•Updated 12 months ago
2import { email } from "https://esm.town/v/std/email";
3
4export async function testEmail2(e: {
5 from: string;
6 to: string[];

kyselyVtTypesmain.tsx2 matches

@pomdtr•Updated 12 months ago
25 tables: string[];
26};
27function parseOptions(params: URLSearchParams): GenerateOptions {
28 const camelCase = params.has("camelCase") ? params.get("camelCase") === "true" : undefined;
29 const excludePattern = params.get("excludePattern") ?? undefined;
43 };
44}
45export default async function(req: Request): Promise<Response> {
46 const url = new URL(req.url);
47 if (url.pathname !== "/") return new Response(null, { status: 404 });

handlermain.tsx1 match

@acmu•Updated 12 months ago
1export function handler(request: Request) {
2 return Response.json({ ok: true });
3}

bookmarkletHighlightForksmain.tsx1 match

@vladimyr•Updated 12 months ago
1function run() {
2 Array.from(document.querySelectorAll(":has(> div > [aria-label^=Forked])"))
3 .map(el => el.style.cssText = "border: 2px solid red;");

pipesmain.tsx1 match

@pomdtr•Updated 12 months ago
12};
13
14export async function pipes(sql: string): Promise<Result> {
15 const origin = "https://pipes.turbot.com";
16 const pathname = `/api/latest/user/${user}/workspace/${workspace}/query`;

beigeSawfishmain.tsx1 match

@stevekrouse•Updated 12 months ago
1import { gzip } from "npm:pako";
2
3export default async function(req: Request): Promise<Response> {
4 return new Response(await gzip(JSON.stringify("hi".repeat(250_000))), {
5 headers: {

compress_responsemain.tsx1 match

@stevekrouse•Updated 12 months ago
1import { gzip } from "npm:pako";
2
3export default async function(req: Request): Promise<Response> {
4 return new Response(await gzip("hi".repeat(250_000)), {
5 headers: {

openapi_emailmain.tsx1 match

@pomdtr•Updated 12 months ago
1import { email } from "https://esm.town/v/std/email?v=11";
2
3export function forwarder(e: {
4 from: string;
5 to: string[];

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