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/$%7Bart_info.art.src%7D?q=function&page=1703&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 18167 results for "function"(3710ms)

artICGetRandommain.tsx1 match

@wilt•Updated 1 year ago
20 boost: false,
21 query: {
22 function_score: {
23 query: {
24 bool: {

hellomain.tsx1 match

@spyder•Updated 1 year ago
1export function hello(name) {
2 return "hi " + name;
3}

getArgsmain.tsx1 match

@sdan•Updated 1 year ago
1import { extractValArgs } from "https://esm.town/v/sdan/extractValArgs";
2
3export async function getArgs(valName: string) {
4 const rep = await extractValArgs(valName);
5 return rep;

projmain.tsx1 match

@tmcw•Updated 1 year ago
1export function proj(ll: Pos2): Pos2 {
2 // Arbitrary.
3 const D2R = Math.PI / 180;

untitled_mutate_test_statemain.tsx1 match

@stevekrouse•Updated 1 year ago
1let { untitled_test_state } = await import("https://esm.town/v/stevekrouse/untitled_test_state");
2
3export function untitled_mutate_test_state(newState) {
4 return (untitled_test_state = newState);
5}

openaiOpenAPImain.tsx8 matches

@stevekrouse•Updated 1 year ago
4 title: Val Town API
5 description: |
6 The Val Town API provides services to evaluate JavaScript and TypeScript expressions, run vals as APIs, either as functions or Express handlers.
7
8 Learn more at [https://docs.val.town](https://docs.val.town)
35 description: |
36 The JavaScript or TypeScript expression to be evaluated.
37 This should be a single expression, like a single function
38 call, assignment operation, or calculation. If you need
39 to execute multiple expressions, wrap them in a function.
40 schema:
41 type: string
44 value: "1+1"
45 summary: Simple addition
46 functionCall:
47 value: "@stevekrouse.addOne(@stevekrouse.example1)"
48 summary: Calling a user's val function
49 handle:
50 name: handle
71 summary: "id"
72 description: |
73 This val is a function that returns its arguments. It is useful for testing how the API handles the arguments passed to it.
74
75 View the val at [https://val.town/v/stevekrouse.id](https://val.town/v/stevekrouse.id)
92 value: 2
93 summary: Simple addition result
94 functionCall:
95 value: 42
96 summary: Calling a function result
97
98security:

unescapeHtmlmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function unescapeHtml(unsafe) {
2 return unsafe
3 .replace(/&/g, "&")

handleFormExample2main.tsx1 match

@stevekrouse•Updated 1 year ago
2import { email } from "https://esm.town/v/std/email?v=9";
3
4export async function handleFormExample2(params) {
5 await email({
6 text: JSON.stringify(params, null, 2),

r2Proxymain.tsx1 match

@stevekrouse•Updated 1 year ago
4import { verifyAPIAuth } from "https://esm.town/v/stevekrouse/verifyAPIAuth";
5
6export async function r2Proxy(key, value, auth) {
7 let { handle } = await verifyAPIAuth(auth);
8 if (!handle)

htmlToMarkdownmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { unescapeHtml } from "https://esm.town/v/stevekrouse/unescapeHtml";
2
3export async function htmlToMarkdown(str) {
4 let unescaped = await unescapeHtml(str);
5 return unescaped

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