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/$2?q=function&page=38&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 29291 results for "function"(4300ms)

xxxclearinghouse_urlscraperindex.ts9 matches

@toowiredโ€ขUpdated 17 hours ago
68};
69
70// Advanced scraping function with error handling and rate limiting
71async function scrapeWebsite(query: string, websiteUrl: string): Promise<ScrapingResult> {
72 const startTime = Date.now();
73 const results: ScrapingResult = {
162}
163
164// HTML parsing function using regex patterns (since DOMParser isn't available in server context)
165async function parseProductsFromHTML(html: string, siteConfig: any, baseUrl: string): Promise<any[]> {
166 const products: any[] = [];
167
192
193// Extract product data using regex patterns
194async function extractProductData(productHtml: string, siteConfig: any, baseUrl: string): Promise<any> {
195 const product: any = {
196 source: new URL(baseUrl).hostname,
250}
251
252// Main export function
253export default async function urlScrapeTemplate(query: string, website: string): Promise<ScrapingResult> {
254 try {
255 // Input validation
297}
298
299// Utility function for testing
300export async function testScrapeTemplate(): Promise<void> {
301 const testSites = [
302 'lovehoney.com.au',

xxxclearinghouse_orchestratorindex.ts8 matches

@toowiredโ€ขUpdated 17 hours ago
46];
47
48export default async function orchestrator(request: Request): Promise<Response> {
49 // CORS handling
50 if (request.method === 'OPTIONS') {
223
224// Simplified request validation
225async function validateRequest(requestBody: any): Promise<ProcessedRequest> {
226 try {
227 // Default values
267}
268
269// Simplified scraping function that calls our URL scrape template
270async function scrapeWebsite(query: string, website: string): Promise<any> {
271 // This would normally import and call the actual URL scrape template
272 // For now, we'll simulate the call with a simplified version
313
314// Product consolidation and deduplication
315async function consolidateProducts(products: any[], minimumDiscount: number): Promise<any[]> {
316 if (!products || products.length === 0) {
317 return [];
356
357// Generate a unique product ID
358function generateProductId(product: any): string {
359 const source = product.source || 'unknown';
360 const title = product.title || 'untitled';
365
366// Calculate summary statistics
367function calculateSummary(results: ScrapingResult[], products: any[]): any {
368 const successfulSites = results.filter(r => r.status === 'success').length;
369 const totalProducts = products.length;
387
388// Health check endpoint
389export async function healthCheck(): Promise<Response> {
390 return new Response(JSON.stringify({
391 status: 'healthy',

registry-valsconfig.json5 matches

@dinavinterโ€ขUpdated 17 hours ago
22 "color": "green",
23 "description": "HTTP endpoint handler",
24 "template": "export default async function(req: Request): Promise<Response> {\n return new Response(\"Hello World\", {\n headers: { \"Content-Type\": \"text/plain\" }\n });\n}"
25 },
26 "interval": {
30 "color": "blue",
31 "description": "Scheduled task handler",
32 "template": "export default async function(interval: Interval) {\n console.log(\"Cron job executed at:\", new Date().toISOString());\n // Your scheduled task logic here\n}"
33 },
34 "email": {
38 "color": "purple",
39 "description": "Email handler",
40 "template": "export default async function(email: Email) {\n console.log(\"Received email from:\", email.from);\n console.log(\"Subject:\", email.subject);\n console.log(\"Body:\", email.text);\n // Your email processing logic here\n}"
41 },
42 "json": {
54 "color": "blue",
55 "description": "TypeScript file",
56 "template": "// TypeScript file\nexport function example(): string {\n return \"Hello from TypeScript!\";\n}"
57 },
58 "js": {
62 "color": "yellow",
63 "description": "JavaScript file",
64 "template": "// JavaScript file\nexport function example() {\n return \"Hello from JavaScript!\";\n}"
65 },
66 "md": {

registry-valszon3 matches

@dinavinterโ€ขUpdated 17 hours ago
29};
30
31function getFileTypeInfo(file: File): TypeInfo {
32 const fileName = file.name || file.path || file.fileName;
33 const extension = fileName?.split(".").pop()?.toLowerCase();
70});
71
72async function getZon(zon: string) {
73 const client = new ValTown();
74 // Get files
103 const { files } = await getZon(zon);
104
105 function withTypeInfo(file: File) {
106 const fileName = file.name || file.path || file.fileName;
107

Plantfotest.html1 match

@Lladโ€ขUpdated 18 hours ago
46
47 <script>
48 async function testPlant() {
49 const plantName = document.getElementById('plantInput').value.trim();
50 const responseContent = document.getElementById('responseContent');

registry-valssync4 matches

@dinavinterโ€ขUpdated 18 hours ago
7const client = new ValTown();
8
9export default async function(interval: Interval) {
10 try
11 {
29}
30
31export async function sync() {
32 console.log(`Running Val Town to Y.js update: ${new Date().toISOString()}`);
33
61} & Record<string, any>[];
62
63async function valSync({ id, name, ...meta }: { name: string; id: string }) {
64 const valMap = valsDoc.getMap(name);
65
103}
104
105async function fileSync({ val, name, path, key, ...meta }: File) {
106 const content = await client.vals.files.getContent(val, { path, name }).then(res => res.text());
107

puppeteer_testmain.tsx1 match

@AIWBโ€ขUpdated 18 hours ago
12});
13
14async function main() {
15 let session;
16 let browser;

EEPPortalApp.tsx5 matches

@solomonferedeโ€ขUpdated 20 hours ago
23};
24
25async function hashPassword(password: string): Promise<string> {
26 const encoder = new TextEncoder();
27 const data = encoder.encode(password);
32}
33
34function App() {
35 const [user, setUser] = useState<any>(null);
36 const [view, setView] = useState("login");
163 };
164
165 // Function to navigate to NewsArticleTab
166 const navigateToNewsArticleTab = () => {
167 setView("news");
450}
451
452function client() {
453 const rootElement = document.getElementById("root");
454 if (rootElement) {
463}
464
465export default async function server(request: Request) {
466 try {
467 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

SON-GOKUREADME.md2 matches

@Itssongokuโ€ขUpdated 20 hours ago
27- **Export/Import**: Backup and restore your BIN collection as JSON
28- **Local Storage**: Secure browser-based storage with automatic saving
29- **Copy Functions**: Copy BIN only or full card data with one click
30- **Generate Integration**: Quick access to card generator with selected BIN
31- **Featured BINs**: Pre-loaded collection with premium BIN examples
124โ”‚ โ”‚ โ”œโ”€โ”€ Card3D.tsx # 3D card component
125โ”‚ โ”‚ โ”œโ”€โ”€ BulkResults.tsx # Bulk generation results
126โ”‚ โ”‚ โ”œโ”€โ”€ BinLookup.tsx # BIN lookup functionality
127โ”‚ โ”‚ โ”œโ”€โ”€ BINExtrap.tsx # BIN collection management
128โ”‚ โ”‚ โ”œโ”€โ”€ TelegramLinks.tsx # Telegram channel and creator links

SON-GOKUindex.ts4 matches

@Itssongokuโ€ขUpdated 20 hours ago
42 }
43
44 // Import validation function
45 const { validateCardNumber } = await import("../shared/utils.ts");
46 const isValid = validateCardNumber(cardNumber);
64 }
65
66 // Import generation functions
67 const {
68 generateCardData,
167 }
168
169 // Import validation function
170 const { validateBulkFormat, getFormatExamples } = await import("../shared/utils.ts");
171
191 }
192
193 // Import validation function
194 const { validateBin, detectCardType } = await import("../shared/utils.ts");
195
tuna

tuna9 file matches

@jxnblkโ€ขUpdated 1 day ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouserโ€ขUpdated 1 month 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.