1export function sleep(ms: number) {
2 return new Promise((resolve) => setTimeout(resolve, ms));
3}
1export async function parseXML(xml) {
2 const { XMLParser } = await import("https://esm.sh/fast-xml-parser@4.1.2");
3 const parser = new XMLParser();
3import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts";
4
5export async function hnFollowPollJob({ lastRunAt }) {
6 let posts = await hnLatestPosts({
7 authors: hackerNewsAuthors,
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(
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",
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1import { valForm } from "https://esm.town/v/rodrigotello/valForm";
2import { multiplicationFunctionTest } from "https://esm.town/v/rodrigotello/multiplicationFunctionTest";
3
4export async function FunctionToHTMLForm(
5 req: express.Request,
6 res: express.Response,
7) {
8 let myFunctionValAsHTML = multiplicationFunctionTest; // Insert your function here and it should generate an HTML form
9 return res.send(`${valForm(myFunctionValAsHTML)}`);
10}
1export async function timeAgo(date: Date) {
2 const { timeAgo } = await import("https://deno.land/x/time_ago/mod.ts");
3 return timeAgo(new Date(date));
1import { valTownInspoList } from "https://esm.town/v/rodrigotello/valTownInspoList";
2
3export function vtInspoHTML(req, res) {
4 res.send(
5 valTownInspoList.map((valTownInspo) =>
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",