6
7
8The client offers a way for you to subscribe to queue updates. This is useful if you want to get notified when a function is done running, or if you want to get the logs as they are being generated.
9
10```js
11import fal from "npm:@fal-ai/serverless-client";
12
13const result = await fal.subscribe(FUNCTION_ID, {
14 input: {
15 seed: 176400,
1export function parse(email: Email) {
2 const name = email.from.split(" <")[0];
3 const bot = name.includes("[bot]");
3import { parse } from "https://esm.town/v/wittjosiah/parse_github_email";
4
5export default async function(message: Email) {
6 try {
7 const { title, description, url, name, bot, reason } = parse(message);
1import process from "node:process";
2
3export async function gitlabSitemap(
4 req: express.Request,
5 res: express.Response
2import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
3
4export default async function ({ url }: BrowserContext) {
5 const { author, name } = extractValInfo(url);
6 await navigator.clipboard.writeText(`${author}/${name}`);
2import { blob } from "https://esm.town/v/std/blob?v=10";
3
4export async function svgMapOfCountry(country: string) {
5 const mapUrl = (await countryData())
6 .find((value) => value.countryLabel === country)
63 let svgString = `<svg viewBox="${viewBox}" xmlns="http://www.w3.org/2000/svg">\n`;
64
65 // Function to convert a ring to a path data string
66 const ringToPathD = (ring) => {
67 let d = `M ${ring[0][0]} ${90 - ring[0][1]} `;
11const CACHE_KEY = "cache-jdan/countryData";
12
13export async function countryData(): Promise<Entry[]> {
14 const cached = await blob.getJSON(CACHE_KEY);
15 if (cached) {
1export async function sparql(query) {
2 const url = `https://query.wikidata.org/sparql?query=${encodeURIComponent(query)}`;
3 const res = await fetch(url, {
6
7// TODO: implement options
8export async function createServer(db, options: Options & { auth?: { username: string; password: string } } = {}) {
9 const app = new Hono();
10
2import { sleep } from "https://esm.town/v/neverstew/sleep";
3
4export default async function(req: Request): Promise<Response> {
5 inTheBackground(async () => {
6 await sleep(3000);
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": "*",