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=1765&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 20200 results for "function"(1725ms)

aiREADME.md1 match

@yawnxyz•Updated 1 year ago
8
9```
10async function calculateEmbeddings(text) {
11 const url = `https://yawnxyz-ai.web.val.run/generate?embed=true&value=${encodeURIComponent(text)}`;
12

coralMulemain.tsx1 match

@pomdtr•Updated 1 year ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

syncmain.tsx2 matches

@pomdtr•Updated 1 year ago
10}
11
12export async function fetchEnv() {
13 const { data: res, error } = await fetchValTown("/v1/eval", {
14 method: "POST",
28}
29
30export async function fetchValTown<T = any>(
31 path: string,
32 options?: RequestInit & {

htmlExamplemain.tsx1 match

@robertfall•Updated 1 year ago
1// View at https://andreterron-htmlExample.web.val.run?name=Andre
2export default async function(req: Request): Promise<Response> {
3 const query = new URL(req.url).searchParams;
4

chatmain.tsx1 match

@kirineko•Updated 1 year ago
24 // });
25 // const message = data.choices[0].message;
26 // return message.function_call ? message.function_call : message.content;
27};
28

tree_examplemain.tsx2 matches

@pomdtr•Updated 1 year ago
72});
73
74// You can build you own helper function
75function linkItem(title: string, url: string): Item {
76 return {
77 title,

PrintPOSTPayloadmain.tsx2 matches

@andy_blum•Updated 1 year ago
1async function readStream(stream: ReadableStream) {
2 const reader = stream.getReader();
3 const decoder = new TextDecoder();
17}
18
19export default async function(req: Request): Promise<Response> {
20 let body = {};
21

moccasinPrimatemain.tsx1 match

@calebmabry•Updated 1 year ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

articlemain.tsx1 match

@pomdtr•Updated 1 year ago
3import { html } from "https://esm.town/v/stevekrouse/html?v=5";
4
5export function article({
6 val,
7 title,

sunbeamTrendingRepositoriesmain.tsx1 match

@pomdtr•Updated 1 year ago
1import { trendingRepositories } from "https://esm.town/v/pomdtr/trendingRepositories";
2
3export async function sunbeamTrendingRepositories() {
4 const repositories = await trendingRepositories();
5 const items = repositories.map((repo) => ({

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 3 weeks 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.