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=1647&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 18175 results for "function"(1642ms)

basicAuthREADME.md1 match

@stevekrouse•Updated 1 year ago
10import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth";
11
12function handler(req: Request) {
13 return new Response("You are authenticated!");
14}

setSFTidbytImagemain.tsx1 match

@squarethecircle•Updated 1 year ago
2import process from "node:process";
3
4export async function setSFTidbytImage({ image, key }: {
5 image: string;
6 key: string;

untitled_amberBedbugmain.tsx1 match

@sreenandm•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

ImgGenmain.tsx1 match

@rayman•Updated 1 year ago
1import { text2png } from "https://esm.town/v/nilslice/libtext2png";
2
3export default async function(req: Request): Promise<Response> {
4 const img = await text2png("Just give me the PNG", "magenta", 30); // returns a `Blob`
5 return new Response(img, {

untitled_jadeMolluskmain.tsx1 match

@MuXiu1997•Updated 1 year ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

solidExamplemain.tsx1 match

@rayman•Updated 1 year ago
3import { renderToString } from "npm:solid-js/web";
4
5function StlViewer() {
6 return (
7 <StlViewer

favmain.tsx1 match

@yieldray•Updated 1 year ago
3}
4
5export function fav(request: Request) {
6 const url = new URL(request.url);
7 if (url.pathname === "/")

testmain.tsx1 match

@ccallaway93•Updated 1 year ago
1export async function test() {
2 const { default: axios } = await import("npm:axios");
3 const url = "http://207.244.232.58:8011/api/login";

btcPriceAlertmain.tsx1 match

@bojan•Updated 1 year ago
5import { lastBtcPrice } from "https://esm.town/v/stevekrouse/lastBtcPrice";
6
7export async function btcPriceAlert() {
8 let btcPrice = await currency("usd", "btc");
9 let change = Math.abs(btcPrice - lastBtcPrice);

hnFollowAppmain.tsx2 matches

@bort•Updated 1 year 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,

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