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/$%7Burl%7D?q=function&page=1798&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 18182 results for "function"(3154ms)

myApimain.tsx1 match

@yosun•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

formatCurrentDatetimeSentencemain.tsx1 match

@wilt•Updated 1 year ago
1// Outputs, e.g., "It is currently Sunday, May 21, 2023 at 12:11:04 PM Pacific Daylight Time."
2// timeZone should be a tz identifier as listed at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
3export function formatCurrentDatetimeSentence(timeZone: string): string {
4 const dateFormatter = new Intl.DateTimeFormat([], {
5 dateStyle: "full",

pugmain.tsx2 matches

@wilt•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function pug(
4 templateStr: string,
5 args = {},
13 const parser = new (await pugParser).Parser(lexer.getTokens());
14 const { default: genCode } = await pugCodegen;
15 const pugFnStr = genCode(parser.parse(), { inlineRuntimeFunctions: true });
16 const evalResp = await fetch("https://api.val.town/v1/eval", {
17 method: "POST",

myApimain.tsx1 match

@ryanlegler•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

untitled_Secretmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import process from "node:process";
2
3export function untitled_Secret() {
4 return [process.env.test, process.env.test];
5}

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(

getFileEmail4 file matches

@shouser•Updated 1 week 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": "*",