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=821&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 8322 results for "function"(617ms)

discordChannelmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function discordChannel({ botToken, serverId }) {
4 return fetchJSON(
5 `https://discord.com/api/guilds/${serverId}/channels`,

getDayNamemain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function getDayName(date?: Date) {
2 return (date ?? new Date()).toLocaleDateString("en-US", { weekday: "long" });
3}

formFeedbackAlertmain.tsx1 match

@stevekrouse•Updated 1 year ago
3import { docsFeedback } from "https://esm.town/v/stevekrouse/docsFeedback";
4
5export async function formFeedbackAlert(interval: Interval) {
6 let newFeedback = docsFeedback
7 .filter((f) => new Date(f.time) > interval.lastRunAt);

hnFollowPollJobErrormain.tsx1 match

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

pollRSSFeedsmain.tsx1 match

@tmcw•Updated 1 year ago
1import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems?v=6";
2
3export async function pollRSSFeeds() {
4 return Object.entries({
5 mine: "https://macwright.com/rss.xml",

exampleAuthApimain.tsx1 match

@stevekrouse•Updated 1 year ago
3import { verifyAPIAuth } from "https://esm.town/v/stevekrouse/verifyAPIAuth";
4
5export async function exampleAuthApi(arg1, arg2, auth) {
6 let { handle } = await verifyAPIAuth(auth);
7 if (handle) {

alivemain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { wikidata } from "https://esm.town/v/stevekrouse/wikidata";
2
3export async function alive(name) {
4 let data = await wikidata(
5 `SELECT ?person ?personLabel ?birth_date ?death_date WHERE {

nominatimSearchmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function nominatimSearch(params: Search): Promise<Place[]> {
4 return fetchJSON(
5 "https://nominatim.openstreetmap.org/search?" +

pixelmain.tsx2 matches

@stevekrouse•Updated 1 year ago
2import { pixelData } from "https://esm.town/v/stevekrouse/pixelData";
3
4export async function pixel(req: express.Request, res: express.Response) {
5 if (req.path === "/") {
6 let html = `
23 let img = document.getElementsByTagName("img")[0]
24 let input = document.getElementsByTagName("input")[0]
25 input.addEventListener('input', function(e){
26 img.src="/track?id=" + e.target.value
27 })

testEmail2main.tsx1 match

@stevekrouse•Updated 1 year ago
3import { set } from "https://esm.town/v/std/set?v=11";
4
5export async function testEmail2(e: {
6 from: string;
7 to: string[];

getFileEmail4 file matches

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

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago