1export function myApi(name) {
2 return "hi " + name;
3}
2import { sha256OfText } from "https://esm.town/v/jdan/sha256OfText";
3
4export async function hashmail(e: {
5 from: string;
6 to: string[];
1export async function duckDB(url) {
2 const { Database } = await import("npm:duckdb-async");
3 const db = await Database.create(":memory:");
1export function myApi(name) {
2 return "hi " + name;
3}
1export function Snake({ x, y, dir }) {
2 return {
3 body: [
2import { pipe } from "https://esm.town/v/adamgonda/pipe";
3
4export function update({ state, input }) {
5 const newState = pipe(state)(
6 // turnSnake(input),
1import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=3";
2
3export async function aqi(location = "Berlin") {
4 const data = await easyAQI({ location });
5 if (data.severity.includes("Unhealthy")) {
1export function myApi(name) {
2 return "hi " + name;
3}
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",
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",
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": "*",