1export function myApi(name) {
2 return "hi " + name;
3}
1export function schema(req, res) {
2}
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({
1export function randomize(a) {
2 return a.sort(() => Math.random() - Math.random());
3}
2import { mail } from "https://esm.town/v/stevekrouse/mail";
3
4export const emailEcho = function (email: Email) {
5 return mail({
6 to: email.from,
4// Customizable notifications for customizable content for a customizable new criteria
5// Example usage: @stevekrouse.dateMeNotify
6export function notifyNewBy<A>({ getData, isNew, notify, name }: {
7 getData: (d?: Date) => A[] | Promise<A[]>;
8 isNew: (params: {
13 name?: string;
14}) {
15 return async function ({ lastRunAt }: Interval) {
16 const data = await getData(lastRunAt);
17 let newData = data.filter((data) => isNew({ data, lastRunAt }));
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1import { getUrlHostname } from "https://esm.town/v/iakovos/getUrlHostname";
2
3export function renderTopStories(stories: {
4 id: number;
5 title: string;
37 .pipe(new StringOutputParser());
38 // RunnableSequence.from() is equivalent to `.pipe().pipe()`
39 // but will coerce objects (and functions) into runnables
40 const questionStyleChain = RunnableSequence.from([
41 {
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": "*",