Avatar

peterqliu

peterqliu.github.io
Joined January 28, 2023
Public vals
6
selfDestruct
peterqliu
selfDestruct
💥 Deletes the val using it, or whatever url is fed it. Handy for sharing single-use scripts without cluttering people's accounts. If used in an HTTP val, this will run immediately when anyone forks it, making for a zero-click execution as long as ValTown immediately serves a preview of the forked val. Add this to your code last and then do not run it, or you will lose your work. Recommend first checking that the val owner isn't you, so that only forked copies will self-destruct. Usage selfDestruct(import.meta.url) Returns a promise of successful deletion, though the val would not be around to read it.
Script
vt_app_v3
peterqliu
vt_app_v3
@jsxImportSource https://esm.sh/hono@4.0.8/jsx
HTTP
vt_app
peterqliu
vt_app
@jsxImportSource https://esm.sh/hono@4.0.8/jsx
HTTP
dbInit
peterqliu
dbInit
// run this just once
Script
TokenDB
peterqliu
TokenDB
// modify these as necessary. these can change safely without breakage,
Script
generateString
peterqliu
generateString
An interactive, runnable TypeScript val by peterqliu
Script
Next