1export function myApi(name) {
2 var sentence = "hi " + name;
3 console.email(sentence);
1export function kelvinToCelcius(kelvin) {
2 return kelvin - 273.15;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
2import { parseBlock } from "https://esm.town/v/usefulthink/parseBlock";
3
4export async function getAvailableCourses() {
5 const JSDOM = await import("npm:jsdom");
6 const qs = await import("node:querystring");
1export function msToIsoDate(unixMs) {
2 return new Date(unixMs).toISOString().split("T")[0];
3}
1export function myApi(name) {
2 return "hi " + name;
3}
2import { guestCount } from "https://esm.town/v/wesbos/guestCount";
3
4export function displayGuestBook(req: express.Request, res: express.Response) {
5 const message = req.query.message?.slice(0, 15);
6 guestCount++;
2import process from "node:process";
3
4export async function githubNotifications() {
5 const res = await fetch("https://api.github.com/notifications?all=true", {
6 headers: {
1export async function extractArgs(code: string) {
2 const { default: ts } = await import("npm:typescript");
3 // Create a source file from the code string
7 ts.ScriptTarget.Latest,
8 );
9 // Traverse the abstract syntax tree (AST) to find the function declaration
10 function findFunctionDeclaration(
11 node: ts.Node,
12 ): ts.FunctionDeclaration | undefined {
13 if (ts.isFunctionDeclaration(node)) {
14 return node;
15 }
16 return node.forEachChild(findFunctionDeclaration);
17 }
18 // Find the function declaration
19 const functionDeclaration = findFunctionDeclaration(sourceFile);
20 if (!functionDeclaration) {
21 return null;
22 }
23 // Extract argument names and types
24 return functionDeclaration.parameters.map((param) => ({
25 name: code.slice(param.name.pos, param.name.end).trim(),
26 type: param.type
5 lon = +lon;
6 lat = +lat;
7 function dist(station) {
8 return Math.sqrt(
9 Math.pow(station.lat - lat, 2) + Math.pow(station.lon - lon, 2)
A helper function to build a file's email
Simple functional CSS library for Val Town
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": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.