htmlAsync
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
htmlAsync: async fork of @postpostscript/html supporting Promises as replacements
import { delay } from "https://deno.land/x/delay@v0.2.0/mod.ts";
import { html, htmlResponseAsync } from "https://esm.town/v/postpostscript/htmlAsync";
export default function(req: Request) {
return htmlResponseAsync`
${(async () => {
await delay(1000);
return `<script>console.log("sanitized")</script>`;
})()}
${(async () => {
await delay(1000);
return html`<script>console.log("unsanitized")</script>`;
})()}
`;
}
Tests: @postpostscript/htmlAsyncTest
Migrated from folder: HTML/htmlAsync