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=2790&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 28925 results for "function"(2771ms)

tutumain.tsx1 match

@VictorForissier•Updated 1 year ago
1export function tutu() {
2 return "Hello world";
3}

messageBoardmain.tsx1 match

@jdan•Updated 1 year ago
1import { messages } from "https://esm.town/v/jdan/messages";
2
3export function messageBoard(req, res) {
4 // make sure u change this or else i'll get your messages
5 const action = "https://jdan-writeMessage.express.val.run";

myApimain.tsx1 match

@zzz•Updated 1 year ago
1export function myApi(name) {
2 name = name || "Guest";
3 return `Hello, ${name}`;

untitled_rt2wovqomain.tsx1 match

@zachnusbaum•Updated 1 year ago
1export const untitled_rt2wovqo = (async () => {
2 function myApi(name) {
3 return "hi " + name;
4 console.email("hi");

getVectorStoreBuildermain.tsx1 match

@webup•Updated 1 year ago
2import { getModelBuilder } from "https://esm.town/v/webup/getModelBuilder";
3
4export async function getVectorStoreBuilder(docs: object[], spec: {
5 type: "memory" | "baas";
6 provider?: "pinecone" | "milvus";
2import process from "node:process";
3
4export async function GetPelotonWorkoutsAndSaveToAirTable(
5 req: express.Request,
6 res: express.Response,
58 },
59 { typecast: true },
60 function (err, record) {
61 if (err) {
62 console.error(err);

fetchCongressTradeReportsmain.tsx2 matches

@claytn•Updated 1 year ago
9
10
11export async function fetchCongressTradeReports(callback) {
12 const res = await fetchJSON(
13 "https://bff.capitoltrades.com/trades?sortBy=-pubDate"
15 const trades = res.data;
16
17 function isToday(d) {
18 const now = new Date();
19 return (

checkBPPRequirementmain.tsx1 match

@lbb00•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function checkBPPRequirement(imageUrl, minWidth, minHeight) {
4 try {
5 const response = await fetch(imageUrl);

toDatesWithTzmain.tsx1 match

@wilt•Updated 1 year ago
1export async function toDatesWithTz(
2 dateStrings: string[],
3 timeZone: string,

getOpenMeteoForecastmain.tsx1 match

@wilt•Updated 1 year ago
91 cell_selection?: "land" | "sea" | "nearest";
92}
93export async function getOpenMeteoForecast(params: OMParams) {
94 const data = await fetchJSON(
95 `https://api.open-meteo.com/v1/forecast?${new URLSearchParams(
tuna

tuna9 file matches

@jxnblk•Updated 12 hours ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.