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=1413&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 23862 results for "function"(1781ms)

filemain.tsx4 matches

@AIWB•Updated 2 months ago
23}
24
25function getFileEmote(file: RTCFile) {
26 const fileType = file.type.split("/")[0];
27 switch (fileType) {
39}
40
41function App() {
42 const [showModal, setShowModal] = useState(false);
43 const [peerId, setPeerId] = useState("");
523}
524
525function client() {
526 render(<App />, document.getElementById("root")!);
527}
563`;
564
565export default async function server(request: Request): Promise<Response> {
566 const url = new URL(request.url);
567

artisticApricotMackerelmain.tsx3 matches

@Shailesh•Updated 2 months ago
3import React from "https://esm.sh/react@18.2.0";
4
5function LinkInBio() {
6 const links = [
7 {
113};
114
115function client() {
116 createRoot(document.getElementById("root")).render(<LinkInBio />);
117}
118if (typeof document !== "undefined") { client(); }
119
120export default async function server(request: Request): Promise<Response> {
121 return new Response(
122 `

archivoTwitterMileimain.tsx4 matches

@nulo•Updated 2 months ago
6const ARCHIVO_API_TOKEN = Deno.env.get("ARCHIVO_API_TOKEN");
7
8async function fetchLatestTweetUrls(): Promise<string[]> {
9 const response = await fetch(TWEETS_URL);
10 const text = await response.text();
22}
23
24async function checkIfCrawled(url: string): Promise<boolean> {
25 const response = await fetch(ARCHIVO_API_URL, {
26 headers: {
33}
34
35async function crawlUrls(urls: string[]): Promise<void> {
36 if (urls.length === 0) return;
37 const res = await fetch(ARCHIVO_API_URL, {
46}
47
48export default async function(interval: Interval) {
49 console.log("Starting tweet URL crawl job");
50

ReactStreammain.tsx3 matches

@charmaine•Updated 2 months ago
22}
23
24export function render<T>(
25 /** Root-level React component that renders an entire <html> element
26 * including the head and body tags.
41 }
42
43 return async function handler(request: Request): Promise<Response> {
44 const main = reactStream(Component, module);
45 const middleware: Middleware[] = [
76 module: string | false,
77): Middleware =>
78 async function(req: DataRequest, res: Response): Promise<Response> {
79 const { renderToReadableStream } = await import("https://esm.sh/react-dom@18.3.1/server");
80

dotcommain.tsx1 match

@charmaine•Updated 2 months ago
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 return fetch(new URL(url.pathname + url.search, "https://charmaine--e331d93805dc11f0be32569c3dd06744.web.val.run"), {

sdfsdfsdfsjxnReactStream3 matches

@charmaine•Updated 2 months ago
22}
23
24export function render<T>(
25 /** Root-level React component that renders an entire <html> element
26 * including the head and body tags.
41 }
42
43 return async function handler(request: Request): Promise<Response> {
44 const main = reactStream(Component, module);
45 const middleware: Middleware[] = [
76 module: string | false,
77): Middleware =>
78 async function(req: DataRequest, res: Response): Promise<Response> {
79 const { renderToReadableStream } = await import("https://esm.sh/react-dom@18.3.1/server");
80

sdfsdfsdfsjxnredirects1 match

@charmaine•Updated 2 months ago
65];
66
67export default async function redirectMiddleware(req: DataRequest, res: Response, next): Promise<Response> {
68 const match = paths.find(p => p.match(req.data.pathname));
69 // const match = paths.find(p => p.regex.match(req.data.pathname));

sdfsdfsdfsjxnrss2 matches

@charmaine•Updated 2 months ago
4import type { Middleware } from "https://esm.town/v/jxnblk/ReactStream";
5
6function generateRSSFeed(posts) {
7 return `
8 <rss version="2.0">
27}
28
29function escapeXml(unsafe) {
30 return unsafe.replace(/[<>&'"]/g, c => {
31 switch (c) {

sdfsdfsdfsjxndotcom2 matches

@charmaine•Updated 2 months ago
36};
37
38async function getInitialProps(req: DataRequest, res: Response, next): Promise<Response> {
39 let params: Params = {};
40 let route: Route = Route.Home;
72}
73
74async function cacheHeaders(req: DataRequest, res: Response, next): Promise<Response> {
75 res.headers.set("Cache-Control", "max-age=31536000");
76 return next();

mynewprojectjxnReactStream3 matches

@charmaine•Updated 2 months ago
22}
23
24export function render<T>(
25 /** Root-level React component that renders an entire <html> element
26 * including the head and body tags.
41 }
42
43 return async function handler(request: Request): Promise<Response> {
44 const main = reactStream(Component, module);
45 const middleware: Middleware[] = [
76 module: string | false,
77): Middleware =>
78 async function(req: DataRequest, res: Response): Promise<Response> {
79 const { renderToReadableStream } = await import("https://esm.sh/react-dom@18.3.1/server");
80

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 month 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.