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=1624&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 19270 results for "function"(1916ms)

pingNationsmain.tsx2 matches

@bohaska•Updated 10 months ago
1function sleep(ms) {
2 return new Promise((resolve) => {
3 setTimeout(resolve, ms);
5}
6
7export default async function(interval: Interval) {
8 const nations = Deno.env.get("PING_NATIONS").split(",");
9 const passwords = Deno.env.get("PING_NATIONS_PASSWORD").split(",");

nationstatesSentimentAImain.tsx3 matches

@bohaska•Updated 10 months ago
3const option_regex = /<OPTION id="(\d+)">(.*?)<\/OPTION>\s*/g;
4
5function sleep(ms) {
6 return new Promise((resolve) => {
7 setTimeout(resolve, ms);
9}
10
11async function query(data) {
12 const response = await fetch(
13 "https://api-inference.huggingface.co/models/cardiffnlp/twitter-roberta-base-sentiment-latest",
26}
27
28export default async function(interval: Interval) {
29 const httpHeaders = {
30 "User-Agent": `${Deno.env.get("EMAIL")} AI Issue Answering`,

test_explorer_routermain.tsx2 matches

@maxm•Updated 10 months ago
63});
64
65async function loadTests(): Promise<TestType[]> {
66 const query = `https://esm.town/v/${author}/test_explorer`;
67 const { data: vals } = await api(`/v1/search/vals?query=${query}`, { authenticated: true });
90}
91
92async function loadHistory(): Promise<HistoryEntry[]> {
93 try {
94 const entries = await readHistory();

routermain.tsx2 matches

@maxm•Updated 10 months ago
62});
63
64async function loadTests(): Promise<TestType[]> {
65 const query = `https://esm.town/v/${author}/test_explorer`;
66 const { data: vals } = await api(`/v1/search/vals?query=${query}`, { authenticated: true });
89}
90
91async function loadHistory(): Promise<HistoryEntry[]> {
92 try {
93 const entries = await readHistory();

test_explorer_routermain.tsx2 matches

@pomdtr•Updated 10 months ago
62});
63
64async function loadTests(): Promise<TestType[]> {
65 const query = `https://esm.town/v/${author}/test_explorer`;
66 const { data: vals } = await api(`/v1/search/vals?query=${query}`, { authenticated: true });
89}
90
91async function loadHistory(): Promise<HistoryEntry[]> {
92 try {
93 const entries = await readHistory();

dubLinkMakermain.tsx3 matches

@mux•Updated 10 months ago
12const encoder = new TextEncoder();
13
14function uint8ArrayToHexString(uint8Array: Uint8Array): string {
15 return Array.from(uint8Array)
16 .map(byte => byte.toString(16).padStart(2, "0"))
18}
19
20function parseFormData(formDataString: string): Record<string, string> {
21 const params = new URLSearchParams(formDataString);
22 const formData: Record<string, string> = {};
27}
28
29export default async function(req: Request): Promise<Response> {
30 if (req.method !== "POST") {
31 return Response.json({ message: "This val responds to POST requests." }, {

clientMultirouteReactmain.tsx1 match

@iamseeley•Updated 10 months ago
6import { personalData } from "https://esm.town/v/iamseeley/personalData";
7
8export default function handler(req: Request): Response {
9 const html = `
10 <!DOCTYPE html>

multirouteSveltemain.tsx2 matches

@iamseeley•Updated 10 months ago
74});
75
76// Main handler function
77export default function (req: Request): Response {
78 const url = new URL(req.url);
79 let component;

multiroutePreactmain.tsx2 matches

@iamseeley•Updated 10 months ago
79);
80
81// Main handler function
82export default function (req: Request): Response {
83 const url = new URL(req.url);
84 let component;

multirouteReactmain.tsx1 match

@iamseeley•Updated 10 months ago
114};
115
116export default function handler(req: Request): Response {
117 const url = new URL(req.url);
118 const currentPath = url.pathname;

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.