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/$2?q=function&page=2737&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 29319 results for "function"(5069ms)

provideBlobExamplemain.tsx1 match

@postpostscript•Updated 1 year ago
5import { provideBlob } from "https://esm.town/v/postpostscript/provideBlob";
6
7export default async function(req: Request): Promise<Response> {
8 const expensiveContent = provideBlob(async () => {
9 await delay(2000 + Math.random() * 3000);

provideBlobREADME.md1 match

@postpostscript•Updated 1 year ago
10import { provideBlob } from "https://esm.town/v/postpostscript/provideBlob";
11
12export default async function(req: Request) {
13 const image = provideBlob(async () => {
14 const png = new Image(100, 100);

blobmanagermain.tsx1 match

@agmm•Updated 1 year ago
6const app = new Hono();
7
8function getValUrl() {
9 const val = rootRef();
10 return `https://${val.userHandle}-${val.valName}.web.val.run`;

youTubeCommentWatchermain.tsx3 matches

@mux•Updated 1 year ago
36`;
37
38function rowObjects(data) {
39 return data.rows.map(row => {
40 return data.columns.reduce((obj, column, index) => {
51}
52
53export default async function() {
54 const API_KEY = Deno.env.get("YOUTUBE_API_KEY");
55 const CHANNEL_ID = Deno.env.get("YOUTUBE_CHANNEL_ID");
57
58 const allComments = [];
59 async function fetchComments(pageToken: string = ""): Promise<void> {
60 const url =
61 `https://www.googleapis.com/youtube/v3/commentThreads?key=${API_KEY}&textFormat=plainText&part=snippet&allThreadsRelatedToChannelId=${CHANNEL_ID}&pageToken=${pageToken}`;

rootValRefmain.tsx1 match

@andreterron•Updated 1 year ago
2import { ValRef } from "https://esm.town/v/andreterron/ValRef?v=1";
3
4export function rootValRef(): ValRef | undefined {
5 const val = rootRef();
6 return val

sqliteExplorerAppREADME.md1 match

@pomdtr•Updated 1 year ago
26- [ ] add visible output for non-query statements
27- [ ] add schema viewing
28- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers))
29- [ ] add export to sqlite
30- [ ] add refresh to table list sidebar after `CREATE/DROP/ALTER` statements

vueExamplemain.tsx1 match

@postpostscript•Updated 1 year ago
47);
48
49export default function(req: Request) {
50 return htmlResponse`
51 ${

basicDownDetectormain.tsx1 match

@agmm•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email";
2
3export async function basicDownDetector() {
4 const now = new Date();
5 const url = "https://agmm.xyz/";

ReloadScriptREADME.md1 match

@postpostscript•Updated 1 year ago
12import { ReloadScript } from "https://esm.town/v/[username]/ReloadScript";
13
14export default async function(req: Request): Promise<Response> {
15 return htmlResponse`
16 It worked!!! ${Math.random()}

headersmain.tsx1 match

@agmm•Updated 1 year ago
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 const headers = Object.fromEntries(req.headers.entries());
tuna

tuna9 file matches

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