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=1356&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 18949 results for "function"(2258ms)

rssToBskymain.tsx1 match

@faekiva•Updated 5 months ago
11];
12
13export async function pollRSSFeeds({ lastRunAt }: Interval) {
14 const password = Deno.env.get(bskyPassword);
15

bskymain.tsx1 match

@daisuke•Updated 5 months ago
5};
6
7export default async function(req: Request): Promise<Response> {
8 const url = "https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=dai.bsky.social&filter=posts_no_replies";
9

SendErrorToDiscordmain.tsx1 match

@faekiva•Updated 5 months ago
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
2
3export async function reportErrorAndExit(source: string, message: string) {
4 let content = "# Error from " + source;
5 const append = (text: string) => {

encouragingAmethystTickmain.tsx1 match

@efsmert•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2async function fetchRandomJoke() {
3 const response = await fetch(
4 "https://official-joke-api.appspot.com/random_joke",

amicableAquamarinePanthermain.tsx1 match

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

CS1200main.tsx1 match

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

constantTomatoTarantulamain.tsx1 match

@henrique056•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3async function fetchRandomJoke() {
4 const response = await fetch(
5 "https://official-joke-api.appspot.com/random_joke",

CS1200Projmain.tsx2 matches

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

readablemain.tsx1 match

@neverstew•Updated 5 months ago
2import { JSDOM } from "npm:jsdom";
3
4export default async function(req: Request) {
5 let resp = await fetch(`https://${new URL(req.url).pathname.replace(/^https?:\/\//, '')}`, req);
6 let body = await resp.text();

uptimemain.tsx6 matches

@vyatka•Updated 5 months ago
5
6// Existing uptime check logic
7async function uptimeCheck(url: string) {
8 let reason: string, status: number, end: number;
9 let ok = true;
40
41// Run uptime checks on startup
42async function runUptimeChecks() {
43 ["https://students.kpfu.ru", "https://media.kpfu.ru"].forEach(uptimeCheck);
44}
46
47// React Frontend Component
48function UptimeDashboard() {
49 const [uptimeData, setUptimeData] = useState([]);
50 const [loading, setLoading] = useState(true);
51
52 useEffect(() => {
53 async function fetchUptimeData() {
54 try {
55 const response = await fetch('/uptime-data');
111
112// Client-side rendering
113function client() {
114 createRoot(document.getElementById("root")).render(<UptimeDashboard />);
115}
117
118// Server-side handler
119export default async function server(request: Request): Promise<Response> {
120 const url = new URL(request.url);
121

getFileEmail4 file matches

@shouser•Updated 2 weeks 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": "*",