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=830&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 8406 results for "function"(449ms)

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[];

valOutputmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function valOutput(req: Request) {
4 const url = new URL(req.url);
5 const pattern = /^\/([^\/]+)\/([^@]+)(?:@([^\.]+))?$/;

serverlessMatrixEchoBot2main.tsx1 match

@stevekrouse•Updated 1 year ago
1export async function serverlessMatrixEchoBot2(req, res) {
2 console.log(req.path);
3 res.send("<h1>working!</h1>");

sparklineSVGmain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function sparklineSVG({ strokeWidth, data, height, width, fill, stroke }) {
2 let vb_width = data.length - 1;
3 let vb_height = Math.max(...data);

notifyNewmain.tsx2 matches

@stevekrouse•Updated 1 year ago
5// Customizable notifications
6// Example usage: @stevekrouse.dateMeNotify
7export function notifyNew<A>({ getData, name }: {
8 getData: (d?: Date) => A[] | Promise<A[]>;
9 name: string;
10}) {
11 return async function ({ lastRunAt }: Interval) {
12 const oldData = await upstash(name);
13 const currentData = await getData(lastRunAt);

sparklineEx2main.tsx1 match

@stevekrouse•Updated 1 year ago
1import { sparklineSVG } from "https://esm.town/v/stevekrouse/sparklineSVG";
2
3export let sparklineEx2 = function (req, res) {
4 res.set("content-type", "image/svg+xml");
5 res.end(sparklineSVG({

randomizemain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function randomize(a) {
2 return a.sort(() => Math.random() - Math.random());
3}

emailEchomain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { mail } from "https://esm.town/v/stevekrouse/mail";
3
4export const emailEcho = function (email: Email) {
5 return mail({
6 to: email.from,

getFileEmail4 file matches

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

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago