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=1437&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 18736 results for "function"(4140ms)

HTTP_digitalClockmain.tsx3 matches

@rozek•Updated 7 months ago
6const html = htm.bind(h);
7
8function App() {
9 const [time, setTime] = useState(new Date());
10
23}
24
25function client() {
26 render(h(App, {}), document.getElementById("root"));
27}
29if (typeof document !== "undefined") { client(); }
30
31export default async function server(request: Request): Promise<Response> {
32 return new Response(`
33 <!DOCTYPE html>

twitterRecentMentionsmain.tsx4 matches

@charmaine•Updated 7 months ago
4import { socialDataSearch } from "https://esm.town/v/stevekrouse/socialDataSearch";
5
6export default async function server(request: Request): Promise<Response> {
7 // Updated to just Specs post-launch
8 const query = "@Spectacles";
20}
21
22function retResponse(tweets: any[]): Response {
23 const sevenDaysAgo = new Date();
24 sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
75 <script>
76 // Load Twitter widget asynchronously
77 window.twttr = (function(d, s, id) {
78 var js, fjs = d.getElementsByTagName(s)[0],
79 t = window.twttr || {};
84 fjs.parentNode.insertBefore(js, fjs);
85 t._e = [];
86 t.ready = function(f) {
87 t._e.push(f);
88 };

socialDataUpdatemain.tsx4 matches

@charmaine•Updated 7 months ago
8// and displays them as embedded posts with preview images on a dark background.
9
10export default async function server(request: Request): Promise<Response> {
11 const query = "@SnapAR OR \"Lens Studio\"";
12
23}
24
25function retResponse(tweets: any[]): Response {
26 const sevenDaysAgo = new Date();
27 sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
78 <script>
79 // Load Twitter widget asynchronously
80 window.twttr = (function(d, s, id) {
81 var js, fjs = d.getElementsByTagName(s)[0],
82 t = window.twttr || {};
87 fjs.parentNode.insertBefore(js, fjs);
88 t._e = [];
89 t.ready = function(f) {
90 t._e.push(f);
91 };

HTTP_RequestBodymain.tsx1 match

@rozek•Updated 7 months ago
1export default async function (req: Request): Promise<Response> {
2 // Check if the request method is POST
3 if (req.method !== 'POST') {

HTTP_Headersmain.tsx1 match

@rozek•Updated 7 months ago
1export default async function(Request: Request): Promise<Response> {
2 return Response.json(Object.fromEntries(Request.headers.entries()));
3}

HTTP_URLParsermain.tsx1 match

@rozek•Updated 7 months ago
1export default async function(Request: Request): Promise<Response> {
2 const parsedURL = new URL(Request.url);
3

HTTP_StatusCodemain.tsx1 match

@rozek•Updated 7 months ago
1export default async function (req: Request): Promise<Response> {
2 // Extract the path from the request URL
3 const path = new URL(req.url).pathname;

HTTP_HelloWorldmain.tsx1 match

@rozek•Updated 7 months ago
1export default function (request: Request): Response {
2 return new Response("Hello world", {
3 headers: { "Content-Type": "text/plain" },

buildagencymain.tsx3 matches

@elliotbraem•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 return (
7 <div className="container">
28}
29
30function client() {
31 createRoot(document.getElementById("root")).render(<App />);
32}
33if (typeof document !== "undefined") { client(); }
34
35export default async function server(request: Request): Promise<Response> {
36 return new Response(
37 `

youtubeSearchResultsmain.tsx3 matches

@trob•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [query, setQuery] = useState("");
7 const [results, setResults] = useState([]);
71}
72
73function client() {
74 createRoot(document.getElementById("root")).render(<App />);
75}
76if (typeof document !== "undefined") { client(); }
77
78export default async function server(request: Request): Promise<Response> {
79 const url = new URL(request.url);
80 if (url.pathname === "/search") {

getFileEmail4 file matches

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

tuna8 file matches

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