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=1605&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 19402 results for "function"(3032ms)

6const SAMPLE_STORIES_KEY = "hn_sample_stories";
7
8async function initializeSampleStories() {
9 const existingStories = await blob.getJSON(SAMPLE_STORIES_KEY);
10 if (!existingStories) {
6const SAMPLE_STORIES_KEY = "hn_sample_stories";
7
8async function initializeSampleStories() {
9 const existingStories = await blob.getJSON(SAMPLE_STORIES_KEY);
10 if (!existingStories) {
6const SAMPLE_STORIES_KEY = "hn_sample_stories";
7
8async function initializeSampleStories() {
9 const existingStories = await blob.getJSON(SAMPLE_STORIES_KEY);
10 if (!existingStories) {
6const SAMPLE_STORIES_KEY = "hn_sample_stories";
7
8async function initializeSampleStories() {
9 const existingStories = await blob.getJSON(SAMPLE_STORIES_KEY);
10 if (!existingStories) {
1export default async function main(req: Request): Promise<Response> {
2 // Helper functions for Blob storage
3 async function getBlob(key: string): Promise<any> {
4 const response = await fetch(`https://api.val.town/v/std/blob-${key}`);
5 if (!response.ok) throw new Error("Error fetching blob data");
7 }
8
9 async function setBlob(key: string, data: any): Promise<void> {
10 const response = await fetch(`https://api.val.town/v/std/blob-${key}`, {
11 method: "POST",
6const SAMPLE_STORIES_KEY = "hn_sample_stories";
7
8async function initializeSampleStories() {
9 const existingStories = await blob.getJSON(SAMPLE_STORIES_KEY);
10 if (!existingStories) {
12}
13
14export default async function main(req: Request): Promise<Response> {
15 const { method, url } = req;
16 const { pathname, searchParams } = new URL(url);
56}
57
58// Helper function to generate sample stories
59function generateSampleStories(): Story[] {
60 const sampleStories: Story[] = [];
61 for (let i = 1; i <= 30; i++) {
17
18// Store initial sample stories if they don't exist
19async function initializeStories() {
20 const stories = await blob.getJSON(storiesKey);
21 if (!stories) {
25
26// Fetch all stored stories
27async function getStories() {
28 return (await blob.getJSON(storiesKey)) || [];
29}
30
31// Save stories
32async function saveStories(stories) {
33 await blob.setJSON(storiesKey, stories);
34}
64});
65
66export default async function main(req: Request): Promise<Response> {
67 await initializeStories();
68 return app.fetch(req);
15
16// Add 30 fake sample stories
17async function initializeStories() {
18 let stories: Story[] = [];
19 for (let i = 1; i <= 30; i++) {
7
8// Generate some sample stories to start with
9async function initStories() {
10 const stories = [];
11 for (let i = 1; i <= INITIAL_STORIES; i++) {

getFileEmail4 file matches

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