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/$%7Burl%7D?q=function&page=2667&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 29089 results for "function"(1885ms)

generate_invoicemain.tsx1 match

@pomdtr•Updated 1 year ago
3import open from "npm:open";
4
5function printHelp() {
6 console.log("help");
7}

uploadTo0x0main.tsx1 match

@easrng•Updated 1 year ago
1export async function uploadTo0x0(data, name) {
2 const blob = new Blob([data]);
3 const formData = new FormData();

jsoninvoice_editor_scriptmain.tsx1 match

@pomdtr•Updated 1 year ago
10const currencySelector = document.getElementById("currencies") as HTMLSelectElement;
11
12async function updatePreview() {
13 try {
14 const code = JSON.parse(editor.code);

creativity_quotesmain.tsx1 match

@generatecoll•Updated 1 year ago
1import process from "node:process";
2
3export async function creativity_quote(request: Request): Promise<Response> {
4 const postgres = await import("https://deno.land/x/postgres/mod.ts");
5 const client = new postgres.Client(process.env.neon_url);

TodoAppmain.tsx6 matches

@summerboys•Updated 1 year ago
5import { Form, hydrate } from "https://esm.town/v/stevekrouse/ssr_react_mini?v=75";
6
7export async function loader(req: Request) {
8 const { sqlite } = await import("https://esm.town/v/std/sqlite?v=4");
9 const [, { columns, rows }] = await sqlite.batch([
20}
21
22export async function action(req: Request) {
23 const { sqlite } = await import("https://esm.town/v/std/sqlite?v=4");
24 const formData = await req.formData();
47}
48
49export function Component({ initialTodos, initialLogs }) {
50 const [todos, setTodos] = useState(initialTodos);
51 const [logs, setLogs] = useState(initialLogs);
54 useEffect(() => addLog(`Client rendered`), []);
55
56 function addTodo() {
57 setTodos([...todos, { text: newTodo }]);
58 setNewTodo("");
64 }
65
66 function toggleTodo(e) {
67 const formData = new FormData(e.target);
68 const id = parseInt(formData.get("id") as string);
71 }
72
73 function deleteTodo(e) {
74 const formData = new FormData(e.target);
75 const id = parseInt(formData.get("id") as string);

pollRSSFeedsmain.tsx1 match

@summerboys•Updated 1 year ago
3import { rssFeeds } from "https://esm.town/v/stevekrouse/rssFeeds";
4
5export async function pollRSSFeeds({ lastRunAt }: Interval) {
6 return Promise.all(
7 Object.entries(rssFeeds).map(async ([name, url]) => {

htmlExamplemain.tsx1 match

@summerboys•Updated 1 year ago
1// View at https://andreterron-htmlExample.web.val.run?name=Andre
2export default async function(req: Request): Promise<Response> {
3 const query = new URL(req.url).searchParams;
4

upload_urlmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1// Function to upload data using Wormhole API and return the URL
2async function uploadToFileIo(file) {
3 const formData = new FormData();
4 formData.append("file", file);

uploadTo0x0main.tsx1 match

@stevekrouse•Updated 1 year ago
1export async function uploadTo0x0(data, name) {
2 const blob = new Blob([data]);
3 const formData = new FormData();

dailyDadJokemain.tsx1 match

@bomberstudios•Updated 1 year ago
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
tuna

tuna9 file matches

@jxnblk•Updated 23 hours 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.