andreterron avatar
andreterron
rootValRef
Script
An interactive, runnable TypeScript val by andreterron
2
postpostscript avatar
postpostscript
recommends
Script
An interactive, runnable TypeScript val by postpostscript
1
andreterron avatar
andreterron
InjectHTMLElementStream
Script
Inject HTML Element Stream Use InjectHTMLElementStream to inject an HTML element inside the <body /> or <html /> tag of a streamed HTML string.
1
postpostscript avatar
postpostscript
valTownLogo
Script
// let me know if this is an issue :)
1
postpostscript avatar
postpostscript
html
Script
html: create sanitized HTML using tagged templates Examples import { html } from "https://esm.town/v/postpostscript/html" const unsafeInput = "<script>alert(1)</script>" console.log(html`Value: ${unsafeInput}`) // Value: &lt;script&gt;alert(1)&lt;/script&gt; These can be combined -- HTML marked as safe (instance is RawHTML ) will be directly inserted: const scripts = html`<script>alert(1)</script>` console.log(html`<head> ${scripts} </head>`.toString()) // <head> // <script>alert(1)</script> // </head> To easily create HTTP Response outputs like @stevekrouse/html, use the htmlResponse utility: import { html, htmlResponse } from "https://esm.town/v/postpostscript/html"; export default function(req: Request) { return htmlResponse` Request URL: ${decodeURIComponent(req.url)} `; } Tests: @postpostscript/htmlTest
1
pomdtr avatar
pomdtr
extractValInfo
Script
Extract vals infos (author, name, version) from a val url (either from esm.town or val.town ). Example usage: const {author, name} = extractValInfo(import.meta.url) Also returns a unique slug for the val: <author>/<name>
15
1
Next
vladimyr-myfooter.web.val.run
Updated: March 7, 2024