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=1605&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 18979 results for "function"(2444ms)

linkInBioTemplatemain.tsx1 match

@saezheneia•Updated 10 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

pwamain.tsx1 match

@pomdtr•Updated 10 months ago
12export type Handler = (req: Request) => Response | Promise<Response>;
13
14export function pwa(handler: Handler, manifest: Partial<ManifestOptions>): Handler {
15 return async (req: Request) => {
16 const url = new URL(req.url);

staleGithubPRsEmailmain.tsx2 matches

@glesica•Updated 10 months ago
5// Sends an email with all the open PRs that have not had any activity
6// for specified period of days
7// Set up this function to run every day (or any interval)
8export async function staleGithubPRsEmail() {
9 // Set up a secret named githubRepos with all the repos you want to analyze (comma separated)
10 let repos = Deno.env.get("githubRepos")?.split(",").filter((r) => r.trim()) ?? [];

sqliteExplorerAppREADME.md1 match

@iamseeley•Updated 11 months 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

emojiDatamain.tsx1 match

@jdan•Updated 11 months ago
8}
9
10export async function emojiData(): Promise<Emoji[]> {
11 const res = await fetch("https://www.unicode.org/Public/draft/emoji/emoji-test.txt");
12 const text = await res.text();

codePointNamesmain.tsx1 match

@jdan•Updated 11 months ago
1export async function codePointNames(): Promise<Record<string, string>> {
2 const res = await fetch("https://unicode.org/Public/UNIDATA/UnicodeData.txt");
3 const text = await res.text();

uploadThruFileIomain.tsx2 matches

@yawnxyz•Updated 11 months 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);

valBackupCronmain.tsx1 match

@iamseeley•Updated 11 months ago
1import { runBackupIfChanged } from 'https://esm.town/v/iamseeley/valBackup';
2
3export default async function (interval: Interval) {
4// await runBackupIfChanged();
5}

convertResumemain.tsx3 matches

@iamseeley•Updated 11 months ago
1
2
3export default async function convertResume(req: Request): Promise<Response> {
4 const html = `
5 <!DOCTYPE html>
119 import { hostResume } from 'https://esm.town/v/iamseeley/hostResume';
120
121 document.getElementById('resumeForm').addEventListener('submit', async function(event) {
122 event.preventDefault();
123 const resumeContent = document.getElementById('resumeContent').value;
151 document.getElementById('copyButton').addEventListener('click', () => copyToClip('jsonOutput'));
152
153 document.getElementById('hostButton').addEventListener('click', async function() {
154 const jsonOutput = document.querySelector('#jsonOutput').innerText;
155 const valTownApiKey = document.getElementById('apiKeyInput').value; // Get the Val Town API key from input

wiitdb_jsonlmain.tsx1 match

@fossforlife•Updated 11 months ago
2import { parseXML } from "https://esm.town/v/stevekrouse/parseXML";
3
4export default async function(req: Request): Promise<Response> {
5 try {
6 const xml = await fetch("https://ej-public-files.sfo3.cdn.digitaloceanspaces.com/wiitdb.xml");

getFileEmail4 file matches

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

tuna8 file matches

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