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=2493&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 31543 results for "function"(19066ms)

adroitCoffeeCrocodileREADME.md2 matches

@maxm•Updated 4 months ago
10import { renderToString } from "npm:react-dom/server";
11
12export default async function(req: Request): Promise<Response> {
13 return new Response(
14 renderToString(
19 {`let hasAnError: string = 10;
20
21function increment(num: number) {
22 return num + 1;
23}

extractValInfomain.tsx1 match

@charmaine•Updated 4 months ago
1export function extractValInfo(url: string | URL) {
2 const { pathname, search } = new URL(url);
3 const [author, filename] = pathname.split("/").slice(-2);

importProjectFilemain.tsx1 match

@maxm•Updated 4 months ago
1export async function importProjectFile(moduleUrl: string, path: string) {
2 const url = new URL(path, moduleUrl);
3 const resp = await fetch(url, { method: "GET", headers: { "Authorization": `Bearer ${Deno.env.get("valtown")}` } });

MrIdentifymain.tsx3 matches

@efaztheistic•Updated 4 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [image, setImage] = useState<File | null>(null);
7 const [result, setResult] = useState<string | null>(null);
98}
99
100function client() {
101 createRoot(document.getElementById("root")).render(<App />);
102}
103if (typeof document !== "undefined") { client(); }
104
105export default async function server(request: Request): Promise<Response> {
106 if (request.method === 'POST' && new URL(request.url).pathname === '/identify') {
107 try {

bubblyTomatoConstrictormain.tsx1 match

@orliesaurus•Updated 4 months ago
1export default async function(interval: Interval) {
2 console.log('hi')
3}

urgentVoicemailAppmain.tsx3 matches

@Vanshii_244•Updated 4 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function LandingPage() {
6 const [imageUrl] = useState(`https://maxm-imggenurl.web.val.run/young-girl-tech-entrepreneur-cartoon-style-holding-smartphone-and-gadgets`);
7
87}
88
89function client() {
90 createRoot(document.getElementById("root")).render(<LandingPage />);
91}
92if (typeof document !== "undefined") { client(); }
93
94export default async function server(request: Request): Promise<Response> {
95 return new Response(`
96 <html>

Prompt_ImproverPrompt_Improver_Includer1 match

@toowired•Updated 4 months ago
1export default async function(request: Request) {
2 const { prompt } = await request.json();
3

Prompt_ImproverPrompt_Improver_Clarifier1 match

@toowired•Updated 4 months ago
1export default async function (request: Request) {
2 const { prompt } = await request.json();
3

generateBackendSchemamain.tsx2 matches

@toowired•Updated 4 months ago
8}
9
10export default async function (req: Request): Promise<Response> {
11 // Set CORS headers
12 const headers = new Headers({
95
96 <script>
97 async function generateSchema() {
98 const description = document.getElementById('description').value;
99 const result = document.getElementById('result');

deployBackendmain.tsx1 match

@toowired•Updated 4 months ago
1export default function deployBackend({ code, schema, dependencies }) {
2 // Input Validation
3 if (!code || typeof code !== 'string') {
tuna

tuna9 file matches

@jxnblk•Updated 2 weeks 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.