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/$%7Bsuccess?q=function&page=1725&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 19379 results for "function"(2072ms)

pollRSSFeedsmain.tsx1 match

@ni554n•Updated 1 year ago
6}
7
8export async function pollRSSFeeds({ lastRunAt }: Interval) {
9 return Promise.all(
10 Object.entries(rssFeeds).map(async ([name, url]) => {

viewSourcemain.tsx1 match

@reecer•Updated 1 year ago
3import { escape } from "npm:html-sloppy-escaper";
4
5export default async function viewSource(req: Request) {
6 const pathname = new URL(req.url).pathname;
7 const html = await fetchText(pathname === "/" ? "example.com" : pathname); // .then(prettifyHtml);

uuidsmain.tsx1 match

@camflan•Updated 1 year ago
1import { v1 as uuidv1, v4 as uuidv4 } from "npm:uuid";
2
3export default async function(req: Request): Promise<Response> {
4 return Response.json({
5 success: true,

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

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 3 weeks ago
Simple functional CSS library for Val Town
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.