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=1516&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 17289 results for "function"(1202ms)

echo_requestmain.tsx1 match

@camflan•Updated 1 year ago
1export default async function(req: Request): Promise<Response> {
2 return Response.json({
3 success: true,

supirmain.tsx1 match

@turbo1912•Updated 1 year ago
4import { renderToString } from "npm:react-dom/server";
5
6export default async function(interval: Interval) {
7 const result = await fal.subscribe("fal-ai/supir", {
8 input: {

weatherGPTmain.tsx1 match

@dantaeyoung•Updated 1 year ago
31console.log(text);
32
33export async function weatherGPT() {
34 await email({ subject: "Weather Today", text });
35}

sqliteExplorerAppREADME.md1 match

@parkerdavis•Updated 1 year ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query

turquoisePiranhamain.tsx1 match

@hmy•Updated 1 year ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

jsonBodyParsingmain.tsx1 match

@tmcw•Updated 1 year ago
1export default async function handler(request: Request) {
2 if (request.method !== "POST") {
3 return Response.json({ message: "This val responds to POST requests." }, {

dateme_notion_syncmain.tsx3 matches

@stevekrouse•Updated 1 year ago
3import { dateMeNotionDatabase } from "https://esm.town/v/stevekrouse/dateMeNotionDatabase";
4
5function jsonifyDoc(doc) {
6 return Object.fromEntries(
7 Object.entries(doc)
13}
14
15function sqlifyDoc(doc) {
16 let keys = Object.keys(doc);
17 let sql = `INSERT INTO DateMeDocs
25}
26
27export default async function sync_dateme_docs() {
28 await sqlite.execute("delete from DateMeDocs");
29

stevekrouse_minimalmain.tsx1 match

@stevekrouse•Updated 1 year ago
8const linkClass = "text-blue-500 hover:underline";
9
10async function getHits() {
11 const [, , { rows: [[allHits]] }, { rows: [[todayHits]] }] = await sqlite.batch([
12 "CREATE TABLE IF NOT EXISTS stevekrouse_com_hits (timestamp DATETIME DEFAULT CURRENT_TIMESTAMP)",

brownBoarmain.tsx1 match

@pomdtr•Updated 1 year ago
1export default function(req) {
2 return new Response("Hello from sandbox");
3}

hono_islandmain.tsx1 match

@pomdtr•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/hono/jsx */
2
3export function Island({
4 src,
5 name,

getFileEmail4 file matches

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

tuna8 file matches

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