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=827&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 8331 results for "function"(717ms)

testSecretmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import process from "node:process";
2
3export function testSecret() {
4 const a = process.env.test;
5 return "can you guess my secret?";

sleepmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function sleep(ms: number) {
2 return new Promise((resolve) => setTimeout(resolve, ms));
3}

parseXMLmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export async function parseXML(xml) {
2 const { XMLParser } = await import("https://esm.sh/fast-xml-parser@4.1.2");
3 const parser = new XMLParser();

hnFollowPollJobmain.tsx1 match

@stevekrouse•Updated 1 year ago
3import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts";
4
5export async function hnFollowPollJob({ lastRunAt }) {
6 let posts = await hnLatestPosts({
7 authors: hackerNewsAuthors,

myExpressApimain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { set } from "https://esm.town/v/std/set?v=11";
3
4export async function myExpressApi(req: express.Request, res: express.Response) {
5 res.json({
6 count: await set(

fetchCongressTradeReportsmain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function fetchCongressTradeReports({ lastRunAt }) {
5 const res = await fetchJSON(
6 "https://bff.capitoltrades.com/trades?sortBy=-pubDate",

testMutateSemanticsmain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function testMutateSemantics({
5 stateName,
6 api,

chatGPTPluginmain.tsx1 match

@stevekrouse•Updated 1 year ago
3
4// https://stevekrouse-chatgptplugin.express.val.run/.well-known/ai-plugin.json
5export async function chatGPTPlugin(req: express.Request, res: express.Response) {
6 if (req.path === "/.well-known/ai-plugin.json") {
7 res.json({

openaiFineTunemain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function openaiFineTune({ key, model, trainingFile }: {
4 key: string;
5 model?: string;

parseSendGridEmailmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1export function parseSendGridEmail(input) {
2 function parseString(input) {
3 if (typeof input === "string") {
4 // parse email out of format like 'name <email@email.com>'

getFileEmail4 file matches

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

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago