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/$1?q=function&page=42&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 31571 results for "function"(4136ms)

stevensDemocronDailyBrief.ts1 match

@moroni•Updated 4 days ago
1import { sendDailyBriefing } from "./sendDailyBrief.ts";
2
3export async function cronDailyBrief() {
4 try {
5 const chatId = Deno.env.get("TELEGRAM_CHAT_ID");

stevensDemoApp.tsx2 matches

@moroni•Updated 4 days ago
62};
63
64export function App() {
65 const [memories, setMemories] = useState<Memory[]>([]);
66 const [loading, setLoading] = useState(true);
139 const data = await response.json();
140
141 // Change the sorting function to show memories in chronological order
142 const sortedMemories = [...data].sort((a, b) => {
143 const dateA = a.createdDate || 0;

my-first-val-204_email.tsx1 match

@webclone_110•Updated 4 days ago
2// Click "Run", copy and paste the email address and send an email to it.
3// This example will log the email details received.
4export default async function emailHandler(email: Email){
5 console.log("Email received!", email.from, email.subject, email.text);
6 for (const file of email.attachments) {

my-first-val-203_cron.tsx1 match

@webclone_110•Updated 4 days ago
2// Configure the timer with the 🕒 icon in the top right.
3// This example just logs the current time.
4export function scheduledHandler() {
5 const timestamp = new Date().toISOString();
6 console.log(`Cron val executed at: ${timestamp}`);

my-first-val-201_script.tsx1 match

@webclone_110•Updated 4 days ago
1// This script returns a random fun fact
2// You can Run scripts manually in this view or call it from other vals.
3export default function getRandomFact() {
4 const funFacts = [
5 "Honey never spoils.",

WS-Chessreact-dom.d.ts1 match

@willscriv•Updated 4 days ago
5 }
6
7 export function createRoot(
8 container: Element | Document | null
9 ): Root;

WS-Chessjsx-runtime.d.ts2 matches

@willscriv•Updated 4 days ago
1declare module 'react/jsx-runtime' {
2 export function jsx(
3 type: string | ComponentClass<any>,
4 props: any,
6 ): ReactElement;
7
8 export function jsxs(
9 type: string | ComponentClass<any>,
10 props: any,

WS-ChessChessBoard.tsx1 match

@willscriv•Updated 4 days ago
14];
15
16export function ChessBoard() {
17 const [board, setBoard] = useState(initialBoard);
18 const [selectedSquare, setSelectedSquare] = useState<Square | null>(null);

WS-ChessApp.tsx1 match

@willscriv•Updated 4 days ago
3import './App.css';
4
5function App() {
6 return (
7 <div className="app">

stevensDemotestDailyBrief.ts1 match

@bkm•Updated 4 days ago
4import { DateTime } from "https://esm.sh/luxon@3.4.4";
5
6export async function testDailyBrief() {
7 try {
8 const testChatId = Deno.env.get("TEST_TELEGRAM_CHAT_ID");
tuna

tuna9 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 2 months ago
A helper function to build a file's email
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.