1export function myApi(name) {
2 return "hi " + name;
3}
1import { compliments } from "https://esm.town/v/vandyand/compliments";
2
3export function get_random_compliment() {
4 const randomIndex = Math.floor(
5 Math.random() * compliments.length,
1export const untitled_cS5pGEaV = (async () => {
2 let count = 0;
3 function myApi() {
4 return count++;
5 }
1export function myApi(name) {
2 return "hi " + name;
3}
1import { scriptTag } from "https://esm.town/v/liamdanielduffy/scriptTag";
2
3export function addReactFromCDN(): string {
4 const reactDom = scriptTag({
5 src: "https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js",
1export function myApi(name) {
2 return JSON.parse(
3 '{"code": 0,"message": "success","data": {"param1": "va success"}}',
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function wttrJson(location: string) {
4 // https://github.com/chubin/wttr.in#json-output
5 return (await fetch(`https://wttr.in/${location}?format=j1`)).json();
1import { fetchXML } from "https://esm.town/v/stevekrouse/fetchXML?v=3";
2
3export const bggTest = async function () {
4 const xml = await fetchXML(
5 "https://boardgamegeek.com/xmlapi2/plays?username=acciopatronus",
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function raw(val: `@${string}.${string}`) {
4 const [owner, name] = val.slice(1).split(".") as string[];
5 return fetchJSON(
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function run(
4 { username, valName, data, token }: Params,
5): Promise<Result> {
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": "*",