1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { api } from "https://esm.town/v/pomdtr/api";
import { gfm } from "https://esm.town/v/pomdtr/gfm";
export async function readmeToHtmlResponse(author: string, name: string) {
return new Response(await readmeToHtml(author, name), {
headers: {
"Content-Type": "text/html",
},
});
}
export async function readmeToHtml(author: string, name: string) {
const markdown = await readme(author, name);
return gfm(markdown);
}
export async function readme(author: string, name: string) {
const { readme } = await api(`/v1/alias/${author}/${name}`);
return readme;
}
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.