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=1418&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 16279 results for "function"(1645ms)

pushNoteREADME.md1 match

@dandivelbiss•Updated 1 year ago
1# Notehub
2
3A set of helper functions for interacting with the Notehub API
4
5Requires `NOTEHUB_CLIENT_ID` and `NOTEHUB_CLIENT_SECRET` [environment variables](https://www.val.town/settings/environment-variables) to be configured.

dailyDadJokemain.tsx1 match

@ajn•Updated 1 year ago
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({

telegramSendMessagemain.tsx1 match

@sjmre•Updated 1 year ago
24 );
25
26export async function telegramSendAudioMessage(chatId: string, audioData: Uint8Array, botToken: string): Promise<void> {
27 const url = `https://api.telegram.org/bot${botToken}/sendAudio`;
28

azureNewtmain.tsx1 match

@suhaasy•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

valToGHmain.tsx5 matches

@nbbaier•Updated 1 year ago
4import { DateTime } from "npm:luxon";
5
6async function getLatestCommit(ghUser: string, ghRepo: string, branch: string, client: Octokit)
7{
8 const { data: refData } = await client.rest.git.getRef({
15}
16
17async function createNewTree(
18 ghUser: string,
19 ghRepo: string,
40}
41
42async function createNewCommit(
43 ghUser: string,
44 ghRepo: string,
60}
61
62async function updateBranchRef(
63 owner: string,
64 repo: string,
92 */
93
94export async function valToGH(
95 repo: string, // owner/repo
96 val: string | string[], // user/val

testmain.tsx1 match

@d•Updated 1 year ago
1export function test(){
2 return Math.random();
3}

htmlExamplemain.tsx1 match

@Llad•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

yellowToadmain.tsx2 matches

@simonw•Updated 1 year ago
2
3const script = `
4def mapFunction(r, i):
5 v = r * i
6 return v
8x = [1, 2, 3, 4]
9x
10 .map(mapFunction)
11 .filter(r => r * r)
12 .join(",")

jsPythonmain.tsx2 matches

@stevekrouse•Updated 1 year ago
2
3const script = `
4def mapFunction(r, i):
5 v = r * i
6 return v
8x = [1, 2, 3, 4]
9x
10 .map(mapFunction)
11 .filter(r => r * r)
12 .join(",")

jsPythonmain.tsx2 matches

@simonw•Updated 1 year ago
3 const { jsPython } = await import("npm:jspython-interpreter");
4 const script = `
5def mapFunction(r, i):
6 v = r * i
7 return v
9x = [1, 2, 3, 4]
10x
11 .map(mapFunction)
12 .filter(r => r * r)
13 .join(",")

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 week 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.