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/image-url.jpg%20%22Image%20title%22?q=function&page=2292&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 24761 results for "function"(4567ms)

dailySubscriptionStatsmain.tsx1 match

@petermillspaugh•Updated 1 year ago
14];
15
16export async function dailyEmailSubscriptionStats(interval: Interval) {
17 const { rows: newSubs } = await sqlite.execute(`
18 SELECT name, email

createEmailLogsmain.tsx1 match

@petermillspaugh•Updated 1 year ago
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function createEmailLogsTable() {
4 await sqlite.execute(
5 `

createNewslettersmain.tsx1 match

@petermillspaugh•Updated 1 year ago
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function createNewslettersTable() {
4 await sqlite.execute(
5 `

get_weather_messagemain.tsx1 match

@cosmo•Updated 1 year ago
2import { getCurrentWeather } from "https://esm.town/v/cosmo/get_current_weather";
3
4export async function getWeatherMessage(apiKey, latitude, longitude) {
5 const currentWeather = await getCurrentWeather(latitude, longitude),
6 { icon } = currentWeather,

get_current_weathermain.tsx1 match

@cosmo•Updated 1 year ago
1export async function getCurrentWeather(latitude = 0, longitude = 0) {
2 const pointsResponse = await fetch(`https://api.weather.gov/points/${latitude},${longitude}`),
3 { properties: { forecastHourly } } = await pointsResponse.json(),

untitled_beigeCrabmain.tsx1 match

@tmcw•Updated 1 year ago
1export async function handle() {
2 // Schedule work to do later
3 new Promise<void>(async (resolve) => {

beaconmain.tsx1 match

@visnup•Updated 1 year ago
2import { parse } from "npm:cookie";
3
4export default async function(req: Request): Promise<Response> {
5 const origin = req.headers.get("origin") ?? "*";
6 const { D = randomUUID() } = parse(req.headers.get("cookie") ?? "");

sleepermain.tsx2 matches

@jamiedubs•Updated 1 year ago
1// a very slow and sleepy function
2// pass it ?sleep=33 to make it sleep for that amount of sleep
3export default async function (req: Request): Promise<Response> {
4 const url = new URL(req.url);
5 const sleepQueryParam = url.searchParams.get('sleep');

status401main.tsx1 match

@patrickroumanoff•Updated 1 year ago
1export default async function(req: Request): Promise<Response> {
2 console.log(req.url);
3 if (req.headers.get("x-fd-healthprobe") == "1") {

lowdbmain.tsx1 match

@pomdtr•Updated 1 year ago
18}
19
20async function BlobPreset<Data>(key: string, initialData: Data) {
21 const db = new Low(new Blob<Data>(key), initialData);
22 await db.read();

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 month 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.