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=1575&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 18574 results for "function"(1628ms)

resumeHandlermain.tsx1 match

@iamseeley•Updated 11 months ago
4import { resumeConfig } from 'https://esm.town/v/iamseeley/resumeConfig';
5
6export default async function resumeHandler(req: Request): Promise<Response> {
7 if (req.method === 'GET') {
8 try {

redSwanmain.tsx1 match

@ianvph•Updated 11 months ago
1import { capturePostHogEvent } from "https://esm.town/v/ianvph/capturePostHogEvent";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method !== "POST") {
5 return Response.json({ ok: "only post request" });

plotHTMLExamplemain.tsx1 match

@stevekrouse•Updated 11 months ago
1import { html } from "https://esm.town/v/stevekrouse/html";
2
3export default async function (req: Request): Promise<Response> {
4 return html(`
5 <!DOCTYPE html>

posthogGitHubStarCapturemain.tsx1 match

@ianvph•Updated 11 months ago
1import { capturePostHogEvent } from "https://esm.town/v/ianvph/capturePostHogEvent";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method !== "POST") {
5 return Response.json({ ok: "only post request" });

posthogGitHubStarCapturemain.tsx1 match

@wallbreaker•Updated 11 months ago
1import { capturePostHogEvent } from "https://esm.town/v/ianvph/capturePostHogEvent";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method !== "POST") {
5 return Response.json({ ok: "only post request" });

uploadImagemain.tsx2 matches

@qqyule•Updated 11 months ago
4 * @returns {string} - uploaded image url
5 */
6export async function uploadImage(image: Blob): Promise<string> {
7 const fd = new FormData();
8 fd.append(
23 return data.result.variants[0];
24}
25async function getUploadURL(): Promise<string> {
26 const data = await (await fetch("https://www.val.town/api/trpc/generateImageUploadUrl", {
27 "headers": {
2import { Context, Hono } from "npm:hono";
3
4// Define the route handler function
5export const Time_Blindness_Loud_Calendar_via_iOS_shortcuts = (c: Context) => {
6 console.log("Route accessed: Time_Blindness_Loud_Calendar_via_iOS_shortcuts");

hnFollowAppmain.tsx2 matches

@rodrigotello•Updated 11 months ago
3import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts?v=18";
4
5export const hnFollowApp = function (authors: string[]) {
6 return async function ({ lastRunAt }) {
7 let posts = await hnLatestPosts({
8 authors,

flashBordermain.tsx1 match

@iamseeley•Updated 11 months ago
1export function flashBorder(element) {
2 if (!element) return;
3 let flash = true;

animateElementmain.tsx2 matches

@iamseeley•Updated 11 months ago
1export function animateElement(element, delay) {
2 return new Promise(resolve => {
3 setTimeout(() => {
8}
9
10export async function animateElementsSimultaneously(elements, initialDelay) {
11 const promises = elements.map(element => animateElement(element, initialDelay));
12 await Promise.all(promises);

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
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": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.