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/$%7Bsuccess?q=function&page=1729&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 19319 results for "function"(3402ms)

codeOnValTownREADME.md1 match

@vladimyr•Updated 1 year ago
49### Linking to the val
50
51These functions infer the val using the call stack or the request URL. If the inference isn't working, or if you want to ensure it links to a specific val, pass the `val` argument:
52
53- `modifyFetchHandler(handler, {val: { handle: "andre", name: "foo" }})`

blob_delete_by_prefixmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { blob } from "https://esm.town/v/std/blob?v=11";
2
3export async function deleteBlobs(prefix: string) {
4 (await blob.list(prefix)).forEach(({ key }) => blob.delete(key));
5}

BalanceBrightDatamain.tsx1 match

@augustohp•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export default async function fetchBrightDataBalance(
4 token: string,
5): Promise<number> {

MyFootermain.tsx3 matches

@vladimyr•Updated 1 year ago
8const USERNAME = extractValInfo(import.meta.url).author;
9
10export async function createInjectMyFooterStream(logo = valTownLogoAuto) {
11 const footer = await MyFooter(logo);
12 return new InjectHTMLElementStream(footer.toString());
13}
14
15export async function MyFooter(logo = valTownLogoAuto) {
16 const recommendation = rootValRef().handle === USERNAME
17 ? html`<span class="recommends">${await recommends()}</span>`
41}
42
43export default async function(req) {
44 const { Layout } = await import("https://esm.town/v/postpostscript/Layout");
45 return htmlResponse`${Layout`

magentaDogmain.tsx2 matches

@Negash•Updated 1 year ago
1let currentNumber = 0; // Assuming starting point, but this could be loaded/stored elsewhere.
2
3// This function increments the number and returns the new value.
4function incrementNumber() {
5 currentNumber += 1;
6 // Here, you would ideally persist the current number to a database or file for long-term storage.

blogAuthmain.tsx1 match

@postpostscript•Updated 1 year ago
2import { getValEndpointFromName } from "https://esm.town/v/postpostscript/meta";
3
4export default function(req: Request) {
5 const { author, name } = extractValInfo(import.meta.url);
6 const blogEndpoint = getValEndpointFromName(`@${author}/blog`);

myIdeasmain.tsx1 match

@postpostscript•Updated 1 year ago
4import { getValEndpointFromName } from "https://esm.town/v/postpostscript/meta";
5
6export default function(req: Request) {
7 const { author, name } = extractValInfo(import.meta.url);
8 const blogEndpoint = getValEndpointFromName(`@${author}/blog`);

twitterAlertmain.tsx1 match

@pomdtr•Updated 1 year ago
4const query = "\"val.town\" OR \"val town\" -_ValTown_";
5
6export async function twitterAlert({ lastRunAt }: Interval) {
7 const results = await twitterSearch({
8 query,

authIdExampleCommentsmain.tsx1 match

@postpostscript•Updated 1 year ago
54export default app.fetch;
55
56async function createPage(c: Context<HonoEnvOptional>) {
57 const auth = c.get("auth");
58

inboxmain.tsx1 match

@pomdtr•Updated 1 year ago
1import { email as sendEmail } from "https://esm.town/v/std/email?v=11";
2
3export default async function(email: Email) {
4 await sendEmail({
5 subject: email.subject,

getFileEmail4 file matches

@shouser•Updated 2 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.