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=913&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 18317 results for "function"(952ms)

truthfulOrangeLlamamain.tsx1 match

@charmaine•Updated 1 month ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

spellbindingGrayChinchillamain.tsx1 match

@charmaine•Updated 1 month ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

ampleTanBuzzardmain.tsx1 match

@charmaine•Updated 1 month ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

constantAmaranthGazellemain.tsx1 match

@charmaine•Updated 1 month ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

linkInBioTemplatemain.tsx1 match

@charmaine•Updated 1 month ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

weatherBotmain.tsx11 matches

@charmaine•Updated 1 month ago
9 "latLngOfCity": {
10 openAiTool: {
11 type: "function",
12 function: {
13 name: "latLngOfCity",
14 description: "Get the latitude and longitude of a city",
34 "weatherOfLatLon": {
35 openAiTool: {
36 type: "function",
37 function: {
38 name: "weatherOfLatLon",
39 description: "Get the latitude and longitude of a city",
61 "fetchWebpage": {
62 openAiTool: {
63 type: "function",
64 function: {
65 name: "fetchWebpage",
66 description: "Fetch the weather forecast from the contents of a forecast URL",
91];
92
93function truncate(response: string | object) {
94 const TRUNCATE_LEN = 60;
95 const responseStr = typeof response === "string" ? response : JSON.stringify(response);
99}
100
101async function runConversation() {
102 const response = await openai.chat.completions.create({
103 messages: transcript,
111 if (message.tool_calls) {
112 for (let i = 0; i < message.tool_calls.length; i++) {
113 console.log("[CALLING]", message.tool_calls[i].function);
114 const tool = toolbox[message.tool_calls[i].function.name];
115 if (tool) {
116 const result = await tool.call(JSON.parse(message.tool_calls[i].function.arguments));
117 console.log("[RESULT]", truncate(result));
118 transcript.push({

aqimain.tsx1 match

@charmaine•Updated 1 month ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "downtown brooklyn"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

sailingNotifyCronmain.tsx1 match

@charmaine•Updated 1 month ago
3import process from "node:process";
4
5export async function sailingNotifyCron({ lastRunAt }) {
6 const result = await sailingNotify("Fair Oaks, CA", 10);
7}

powderNotifyCronmain.tsx1 match

@charmaine•Updated 1 month ago
1import { powderNotify } from "https://esm.town/v/chet/powderNotify";
2
3export default async function(interval: Interval) {
4 await Promise.all([
5 powderNotify("Truckee, CA"),

weatherGPTmain.tsx1 match

@charmaine•Updated 1 month ago
31console.log(text);
32
33export async function weatherGPT() {
34 await email({ subject: "Weather Today", text });
35}

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