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=2124&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 30467 results for "function"(3339ms)

ableLavenderSkunkmain.tsx2 matches

@ajax•Updated 3 months ago
3import { generateText } from "npm:ai";
4
5export default async function(req: Request): Promise<Response> {
6 if (req.method !== "POST") {
7 return Response.json({ message: "This function only accepts POST requests." }, { status: 400 });
8 }
9 try {

generate_pokemon_game_ideasmain.tsx2 matches

@ajax•Updated 3 months ago
3import { generateText } from "npm:ai";
4
5export default async function(req: Request): Promise<Response> {
6 if (req.method !== "POST") {
7 return Response.json({ message: "This function only accepts POST requests." }, { status: 400 });
8 }
9 try {

projects_cms_handlermain.tsx1 match

@saCD•Updated 3 months ago
8const DEBUG = false;
9
10function debugLog(message: any, ...optionalParams: any[]): void {
11 if (DEBUG) {
12 console.log(message, ...optionalParams);

terrificTealStingraymain.tsx1 match

@zshipko•Updated 3 months ago
1export function getCurrentDateTime() {
2 const now = new Date();
3 return {

markdownBlogStarterLayout.tsx1 match

@danny•Updated 3 months ago
2import type { ReactNode } from "npm:react@18.2.0";
3
4export function Layout({ children }: { children: ReactNode }) {
5 return (
6 <html lang="en">

markdownBlogStarterindex.tsx3 matches

@danny•Updated 3 months ago
5import { Layout } from "./Layout.tsx";
6
7function PostComponent({ markdown, link }: { markdown: string; link?: string }) {
8 return (
9 <div style={{ border: "1px solid gray", padding: "10px", marginBottom: "20px", borderRadius: "5px" }}>
14}
15
16export default async function(req: Request): Promise<Response> {
17 const url = new URL(req.url);
18 if (url.pathname === "/") {
44}
45
46function html(children: React.ReactNode) {
47 return new Response(
48 renderToString(

optimizadordenegociosmain.tsx10 matches

@richardrachir•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function BusinessOptimizerApp() {
6 const [stage, setStage] = useState('welcome');
7 const [interests, setInterests] = useState('');
21 });
22
23 function formatMarkdown() {
24 return `# Optimización de Negocio 🚀
25
43 }
44
45 function downloadReport() {
46 const blob = new Blob([formatMarkdown()], { type: 'text/markdown' });
47 const url = URL.createObjectURL(blob);
52 }
53
54 async function generateBuyerPersona() {
55 try {
56 const response = await fetch('/api/generate-buyer-persona', {
81 }
82
83 async function identifyProblems() {
84 try {
85 const response = await fetch('/api/identify-problems', {
108 }
109
110 async function generateSolutions() {
111 try {
112 const response = await fetch('/api/generate-solutions', {
135 }
136
137 async function createIrresistibleOffer() {
138 try {
139 const response = await fetch('/api/create-offer', {
167 }
168
169 function renderStage() {
170 if (error) {
171 return (
382}
383
384function client() {
385 createRoot(document.getElementById("root")).render(<BusinessOptimizerApp />);
386}
388if (typeof document !== "undefined") { client(); }
389
390export default async function server(request: Request): Promise<Response> {
391 const { OpenAI } = await import("https://esm.town/v/std/openai");
392 const openai = new OpenAI();

endearingJadeImpalamain.tsx4 matches

@Website•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function LoanApplicationForm() {
6 const [formData, setFormData] = useState({
7 fullName: "",
157}
158
159function App() {
160 return <LoanApplicationForm />;
161}
162
163function client() {
164 createRoot(document.getElementById("root")).render(<App />);
165}
166if (typeof document !== "undefined") { client(); }
167
168export default async function server(request: Request): Promise<Response> {
169 return new Response(`
170 <html>

hardworkingLimeBarnaclemain.tsx4 matches

@Website•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function LoanApplicationForm() {
6 const [formData, setFormData] = useState({
7 fullName: "",
157}
158
159function App() {
160 return <LoanApplicationForm />;
161}
162
163function client() {
164 createRoot(document.getElementById("root")).render(<App />);
165}
166if (typeof document !== "undefined") { client(); }
167
168export default async function server(request: Request): Promise<Response> {
169 return new Response(`
170 <html>

loanApplicationLandingPageIndiamain.tsx4 matches

@Website•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function LoanApplicationForm() {
6 const [formData, setFormData] = useState({
7 fullName: "",
157}
158
159function App() {
160 return <LoanApplicationForm />;
161}
162
163function client() {
164 createRoot(document.getElementById("root")).render(<App />);
165}
166if (typeof document !== "undefined") { client(); }
167
168export default async function server(request: Request): Promise<Response> {
169 return new Response(`
170 <html>
tuna

tuna9 file matches

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