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%22Optional%20title%22?q=function&page=29&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 18872 results for "function"(615ms)

nameSeeingServermain.tsx3 matches

@SimeonL•Updated 1 day ago
44});
45
46function handleGet(req: ExpressRequest, res: ExpressResponse) {
47 res.send({ namesPreviouslySeen: namesPreviouslySeen.size, mostRecentName });
48}
69const zPostErrorResponse403 = z.object({error: z.string(), correctPrefix: z.number()});
70
71function handlePost(req: ExpressRequest, res: ExpressResponse) {
72 const body = zPostBody.safeParse(req.body);
73 if (!body.success) {
111 send: (json: any) => void;
112}
113export default async function(req: Request): Promise<Response> {
114 let resStatus = 200;
115

CareerCoach20Daymigrations.ts1 match

@prashamtrivedi•Updated 1 day ago
5 * Creates all required tables if they don't already exist
6 */
7export async function initializeDatabase() {
8 // Generate a unique key based on this file's path to avoid collisions
9 const KEY = 'careerCoach'

nightbot-master-commandnew-file-9775.tsx3 matches

@jayden•Updated 1 day ago
5import Wiki from "npm:wikijs";
6
7function parseNightbotHeader(headerValue: string): Record<string, string> | null {
8 if (!headerValue) return null;
9 return headerValue.split("&").reduce((acc, param) => {
14}
15
16// map of built-in handler functions (e.g. weather)
17const commands: Record<
18 string,
201};
202
203export default async function server(request: Request): Promise<Response> {
204 console.log("incoming request:", request.url);
205 if (request.method !== "GET") {
46 * @returns Response with feedback
47 */
48async function handleDailyLog(content) {
49 try {
50 // Prepare log data
103 * @returns Response with status
104 */
105async function handleProgressMetrics(content) {
106 try {
107 // Prepare metrics data
142 * @returns Response with status
143 */
144async function handleTodoUpdate(content) {
145 try {
146 // Validate required fields

aqiutils.ts2 matches

@pepicrft•Updated 1 day ago
48const cacheKey = (location: string) => "easyAQI_v3_" + encodeURIComponent(location);
49
50export async function openAqNowcastAQI(location) {
51 const sensorID = location.sensors.find(s => s.parameter.name === "pm25").id;
52 const data = await fetchJSON(
64}
65
66export async function easyAQI({ location }: {
67 location: string;
68}) {

aqiproxy.ts1 match

@pepicrft•Updated 1 day ago
1const TARGET_URL = "https://api.openaq.org";
2
3export default async function(req: Request): Promise<Response> {
4 const url = new URL(req.url);
5 return fetch(TARGET_URL + url.pathname + url.search, {

aqinominatim.ts1 match

@pepicrft•Updated 1 day ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function nominatimSearch(params: Search): Promise<Place[]> {
4 return fetchJSON(
5 "https://nominatim.openstreetmap.org/search?"

aqimain.tsx1 match

@pepicrft•Updated 1 day ago
4const location = "prospect heights, brooklyn"; // <-- change to place, city, or zip code
5
6export async function aqi(interval: Interval) {
7 const data = await easyAQI({ location });
8 if (!interval.lastRunAt) {

slackbolt.tsx3 matches

@dinavinter•Updated 1 day ago
68});
69
70/** Sample Function Listener */
71app.function("sample_step", async ({ client, inputs, fail, logger }) => {
72 try {
73 const { user_id } = inputs;
135})();
136
137export default async function handleGetRequest(): Promise<Response> {
138 const html = `
139 <html>
GitHub-Release-Notes

GitHub-Release-NotesCommitList.tsx1 match

@charmaine•Updated 1 day ago
7}
8
9export function CommitList({ commits }: CommitListProps) {
10 const [expandedCommit, setExpandedCommit] = useState<string | null>(null);
11

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