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=1755&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 18574 results for "function"(3479ms)

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(

emojifymain.tsx1 match

@wilt•Updated 1 year ago
1export async function emojify(input: string): Promise<string> {
2 const { emojify } = await import("npm:emojify-lyrics");
3 return emojify(input);

test_dlockmain.tsx4 matches

@karfau•Updated 1 year ago
23 ...await import("https://deno.land/std/testing/mock.ts"),
24 } as const,
25 async function should_reject_after_last_attempt(
26 {
27 dlock,
44 });
45 },
46 async function should_reject_ttl_of_0(
47 { dlock, id, ttl, fetchStub, assertMatch, assertRejects },
48 ) {
50 assertMatch(err.message, /ttl/);
51 },
52 async function should_return_lock_on_successful_request(
53 { dlock, deadline, fetchStub, assertFalse, assertEquals },
54 ) {
63 },
64 // runs into endless loop!
65 async function skip_should_reject_when_id_is_locked(
66 { dlock, id, ttl, deadline, fetchStub, assertRejects, assertEquals },
67 ) {

countermain.tsx1 match

@abc3354•Updated 1 year ago
1import { state as state2 } from "https://esm.town/v/abc3354/state";
2
3export const counter = async function () {
4 const [state, setState] = await state2("abc3354/counter", {
5 count: 0,

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