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=1334&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 17278 results for "function"(1197ms)

bedtimeStoryMakermain.tsx1 match

@daniellevine•Updated 8 months ago
36// );
37
38function parseStory(text) {
39 // Split the text into lines and remove empty lines
40 const lines = text.split("\n").filter(line => line.trim() !== "");

hnCloneLuciaOauthmain.tsx3 matches

@yawnxyz•Updated 8 months ago
9import { luciaMiddleware } from "https://esm.town/v/yawnxyz/lucia_middleware_safe";
10
11function App() {
12 const [stories, setStories] = useState([]);
13 const [user, setUser] = useState(null);
174}
175
176function client() {
177 createRoot(document.getElementById("root")).render(<App />);
178}
179if (typeof document !== "undefined") { client(); }
180
181export default luciaMiddleware(async function server(request: Request): Promise<Response> {
182 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
183 const SCHEMA_VERSION = 3

victoriousRoseMothmain.tsx1 match

@ezomode•Updated 8 months ago
11`);
12
13export default async function(req: Request): Promise<Response> {
14 const res = await db.query(`
15 UPDATE test

muddyAmethystLimpetmain.tsx3 matches

@pdebieamzn•Updated 8 months ago
13const localizer = momentLocalizer(moment);
14
15function App() {
16 const [events, setEvents] = useState([]);
17 const [isLoading, setIsLoading] = useState(false);
114}
115
116function client() {
117 createRoot(document.getElementById("root")).render(<App />);
118}
120if (typeof document !== "undefined") { client(); }
121
122async function server(request: Request): Promise<Response> {
123 const { OpenAI } = await import("https://esm.town/v/std/openai");
124 const pdfExtractText = await import("https://esm.town/v/pdebieamzn/pdfExtractText");

calendarEventExtractormain.tsx3 matches

@pdebieamzn•Updated 8 months ago
12const localizer = momentLocalizer(moment);
13
14function App() {
15 const [events, setEvents] = useState([]);
16 const [isLoading, setIsLoading] = useState(false);
75}
76
77function client() {
78 createRoot(document.getElementById("root")).render(<App />);
79}
81if (typeof document !== "undefined") { client(); }
82
83async function server(request: Request): Promise<Response> {
84 const { OpenAI } = await import("https://esm.town/v/std/openai");
85 const pdfExtractText = await import("https://esm.town/v/pdebieamzn/pdfExtractText");

pdfExtractTextmain.tsx1 match

@pdebieamzn•Updated 8 months ago
1import { PDFExtract, PDFExtractOptions } from "npm:pdf.js-extract";
2
3export default async function pdfExtractText(data: ArrayBuffer) {
4 const pdfExtract = new PDFExtract();
5 // const req = await fetch("https://morth.nic.in/sites/default/files/dd12-13_0.pdf");

hackerNewsDigestmain.tsx4 matches

@parkerdavis•Updated 8 months ago
3import { email } from "https://esm.town/v/std/email";
4
5async function fetchStories(type: string, count: number) {
6 const response = await fetch(`https://hacker-news.firebaseio.com/v0/${type}stories.json`);
7 const storyIds = await response.json();
15}
16
17function createStoryHTML(story: any) {
18 return `
19 <li>
28}
29
30function createEmailContent(
31 topStories: any[],
32 newStories: any[],
118}
119
120export default async function server(req: Request) {
121 try {
122 const topStories = await fetchStories("top", 10);

serveGithubRepomain.tsx1 match

@pomdtr•Updated 8 months ago
3import { extname, join } from "jsr:@std/path@0.225.2";
4
5export function serveGithubRepo(params: {
6 owner: string;
7 repo: string;

perlinNoiseFabricMousemain.tsx2 matches

@yawnxyz•Updated 8 months ago
1export default async function (req: Request): Promise<Response> {
2 const html = `<!DOCTYPE html>
3<html>
12 float w = 400;
13
14 // Function to calculate the vertex positions
15 float[] a(float x, float y) {
16 float k = mouseX - x;

perlinNoiseFabricColormain.tsx3 matches

@yawnxyz•Updated 8 months ago
1export default async function (req: Request): Promise<Response> {
2 const html = `<!DOCTYPE html>
3<html>
13 float w = 400;
14
15 // Function to calculate the vertex positions
16 float[] a(float x, float y) {
17 float k = w * noise(t) - x;
31 for (float y = 0; y < w; y += s) {
32 for (float x = 0; x < w; x += s) {
33 // Set the stroke color based on sine functions
34 stroke(
35 128 + 128 * sin(x * 0.01 + t),

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 week 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": "*",